RFR: Ignore `path=` lines in git credential fill output.

JornVernee via github.com duke at openjdk.java.net
Wed Jun 26 20:28:37 UTC 2019


On Wed, 26 Jun 2019 19:05:36 GMT, JornVernee via github.com <duke at openjdk.java.net> wrote:

> On Wed, 26 Jun 2019 18:18:36 GMT, Erik Duveblad via github.com <duke at openjdk.java.net> wrote:
> 
>> On Wed, 26 Jun 2019 15:06:36 GMT, JornVernee via github.com <duke at openjdk.java.net> wrote:
>> 
>>> On Wed, 26 Jun 2019 14:46:42 GMT, JornVernee via github.com <duke at openjdk.java.net> wrote:
>>> 
>>>> On Wed, 26 Jun 2019 14:46:38 GMT, JornVernee via github.com <duke at openjdk.java.net> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> I'm trying out skara, but when running `git fork https://github.com/openjdk/panama git-panama` I'm getting the following exception:
>>>>> 
>>>>> ```
>>>>> Exception in thread "main" java.io.IOException: 'git credential' returned unexpected line: path=
>>>>>         at org.openjdk.skara.cli/org.openjdk.skara.cli.GitCredentials.fill(GitCredentials.java:101)
>>>>>         at org.openjdk.skara.cli/org.openjdk.skara.cli.GitFork.main(GitFork.java:130)
>>>>>         at org.openjdk.skara.cli/org.openjdk.skara.cli.GitSkara.main(GitSkara.java:130)
>>>>> ```
>>>>> 
>>>>> Looks like `path=` is not handled yet?
>>>>> 
>>>>> This PR adds some handling that ignores lines starting with `path=` for now, but maybe any unknown line should be ignored instead of throwing an exception, what do you think?
>>>>> 
>>>>> ----------------
>>>>> 
>>>>> Commits:
>>>>>  - 2149adba:	Ignore `path=` lines in git credential fill output.
>>>>> 
>>>>> Pull request:
>>>>> http://git.openjdk.java.net/skara/pull/7
>>>>> 
>>>>> Webrev:
>>>>> https://openjdk.github.io/cr/skara/7/webrev.00
>>>>> 
>>>>> Patch:
>>>>> http://git.openjdk.java.net/skara/pull/7.diff
>>>>> 
>>>>> Fetch command:
>>>>> git fetch https://github.com/openjdk/skara.git 2149adba:pr/7
>>>> 
>>>> Issue created at: https://bugs.openjdk.java.net/browse/SKARA-21
>>> 
>>> webrev is a 404 for me...
>> 
>> Thanks @JornVernee for your contribution! :tada: 
>> 
>> The patch looks good, have you tried it with a credential with a `path`? I'm thinking that if the user has a `path` set for a credential then we should probably pass that `path` back to `git credential approve`  in `GitCredentials::approve`. Won't we otherwise set the credential for the entire host, or am I missing something? Looking at the [man page](https://git-scm.com/docs/git-credential) it seems like we should pass the `path` back to `git credential approve`
> 
> Yeah, that's a good point. I hadn't looked into it that much. I figured since there was no handling for `path` it was safe to ignore.
> 
> I usually use TortoiseGit, and I'm not really familiar with the `credentials` CLI. Trying to run `git credential fill` manually from the command line seems to hang forever, so I'm not sure how best to test it with a credential with a path.

Okay, I've tested with a credential with a path as well (had to set `credential.useHttpPath=true` in git config for this), and it seems to be working. I can use `git fork` to clone a repo like that. I also see the credential (including the path) appearing in wincred.


More information about the skara-dev mailing list