# [PATCH] completion: remove credential helpers from porcelain commands

5 messages from 2015-05-05 to 2015-05-06. Participants: SZEDER Gábor, Erik Faye-Lund, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/39251

## SZEDER Gábor, 2015-05-05 13:19

Subject: [PATCH] completion: remove credential helpers from porcelain commands
Message-ID: <1430831972-6788-1-git-send-email-szeder@ira.uka.de>
URL: https://gitlist.dev/e/1430831972-6788-1-git-send-email-szeder%40ira.uka.de

```
Don't offer the "main" 'git credential' command or any of the credential
helpers from contrib/credential/ when completing git commands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---

I was tempted to simply filter out 'credential-*', so we don't have to
update this list when new credential helpers arrive.  However, the
'git-credential-*' "namespace" is not explicitly reserved for credential
helpers, users have to set the 'credential.helper' config variable to tell
explicitly that 'git-credential-foo' should be used as credential helper,
and who knows, someone might have his own 'git-credential-bar' command that
does something completely unrelated to git's credential system, so in the
end decided against it.  And credential helpers don't pop up too frequently
anyway.

However, if you think filtering out 'credential-*' is the way to go, I'm
happy to reroll.

 contrib/completion/git-completion.bash | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e0eb6ae..527bb00 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -665,8 +665,13 @@ __git_list_porcelain_commands ()
 		checkout-index)   : plumbing;;
 		commit-tree)      : plumbing;;
 		count-objects)    : infrequent;;
+		credential        : credentials;;
 		credential-cache) : credentials helper;;
+		credential-gnome-keyring) : credentials helpe;;
+		credential-netrc) : credentials helper;;
+		credential-osxkeychain) : credentials helper;;
 		credential-store) : credentials helper;;
+		credential-wincred) : credentials helper;;
 		cvsexportcommit)  : export;;
 		cvsimport)        : import;;
 		cvsserver)        : daemon;;
-- 
1.9.5.msysgit.0

```

## Erik Faye-Lund, 2015-05-05 14:28

Subject: Re: [PATCH] completion: remove credential helpers from porcelain commands
Message-ID: <CABPQNSZAbhzQKoYS=QNOyqUEm0yA9nbFpx8NZdgQ-CiC-rQXVw@mail.gmail.com>
URL: https://gitlist.dev/e/CABPQNSZAbhzQKoYS%3DQNOyqUEm0yA9nbFpx8NZdgQ-CiC-rQXVw%40mail.gmail.com
In-Reply-To: <1430831972-6788-1-git-send-email-szeder@ira.uka.de>

```
On Tue, May 5, 2015 at 3:19 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:
> Don't offer the "main" 'git credential' command or any of the credential
> helpers from contrib/credential/ when completing git commands.
>
> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
> ---
>
> I was tempted to simply filter out 'credential-*', so we don't have to
> update this list when new credential helpers arrive.  However, the
> 'git-credential-*' "namespace" is not explicitly reserved for credential
> helpers, users have to set the 'credential.helper' config variable to tell
> explicitly that 'git-credential-foo' should be used as credential helper,
> and who knows, someone might have his own 'git-credential-bar' command that
> does something completely unrelated to git's credential system, so in the
> end decided against it.  And credential helpers don't pop up too frequently
> anyway.
>
> However, if you think filtering out 'credential-*' is the way to go, I'm
> happy to reroll.
>
>  contrib/completion/git-completion.bash | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index e0eb6ae..527bb00 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -665,8 +665,13 @@ __git_list_porcelain_commands ()
>                 checkout-index)   : plumbing;;
>                 commit-tree)      : plumbing;;
>                 count-objects)    : infrequent;;
> +               credential        : credentials;;
>                 credential-cache) : credentials helper;;
> +               credential-gnome-keyring) : credentials helpe;;

Typo? Should be "helper;;", no?

```

## Jeff King, 2015-05-05 20:06

Subject: Re: [PATCH] completion: remove credential helpers from porcelain commands
Message-ID: <20150505200607.GB12067@peff.net>
URL: https://gitlist.dev/e/20150505200607.GB12067%40peff.net
In-Reply-To: <1430831972-6788-1-git-send-email-szeder@ira.uka.de>

```
On Tue, May 05, 2015 at 03:19:32PM +0200, SZEDER Gábor wrote:

> Don't offer the "main" 'git credential' command or any of the credential
> helpers from contrib/credential/ when completing git commands.

Makes sense to me, modulo the typo Erik pointed out.

> I was tempted to simply filter out 'credential-*', so we don't have to
> update this list when new credential helpers arrive.  However, the
> 'git-credential-*' "namespace" is not explicitly reserved for credential
> helpers, users have to set the 'credential.helper' config variable to tell
> explicitly that 'git-credential-foo' should be used as credential helper,
> and who knows, someone might have his own 'git-credential-bar' command that
> does something completely unrelated to git's credential system, so in the
> end decided against it.  And credential helpers don't pop up too frequently
> anyway.
> 
> However, if you think filtering out 'credential-*' is the way to go, I'm
> happy to reroll.

I'd actually be fine with just marking all credential-* as "credentials
helper". I think we have staked out the "git-credential-foo" namespace,
so anybody putting something unrelated in there deserves what they get.
And it makes one fewer list to keep up to date.

I _do_ have other git-credential-foo's that should be ignored (and are
not in your list), but I am probably the only person in the world (they
are due to me experimenting with the credential helper code :) ).

-Peff

```

## Junio C Hamano, 2015-05-05 21:36

Subject: Re: [PATCH] completion: remove credential helpers from porcelain commands
Message-ID: <xmqqzj5id7v7.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqzj5id7v7.fsf%40gitster.dls.corp.google.com
In-Reply-To: <20150505200607.GB12067@peff.net>

```
Jeff King <peff@peff.net> writes:

>> However, if you think filtering out 'credential-*' is the way to go, I'm
>> happy to reroll.
>
> I'd actually be fine with just marking all credential-* as "credentials
> helper". I think we have staked out the "git-credential-foo" namespace,
> so anybody putting something unrelated in there deserves what they get.
> And it makes one fewer list to keep up to date.
>
> I _do_ have other git-credential-foo's that should be ignored (and are
> not in your list), but I am probably the only person in the world (they
> are due to me experimenting with the credential helper code :) ).

Let's do this on top of the "typofix helper" one, as there was
another show-stopper typo.  I could also amend the log message
and declare that we now squat on git-credential-<anything>, but
I do not think it is necessary.

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index fdf0ddc..af78212 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -665,13 +665,8 @@ __git_list_porcelain_commands ()
 		checkout-index)   : plumbing;;
 		commit-tree)      : plumbing;;
 		count-objects)    : infrequent;;
-		credential        : credentials;;
-		credential-cache) : credentials helper;;
-		credential-gnome-keyring) : credentials helper;;
-		credential-netrc) : credentials helper;;
-		credential-osxkeychain) : credentials helper;;
-		credential-store) : credentials helper;;
-		credential-wincred) : credentials helper;;
+		credential)       : credentials;;
+		credential-*)     : credentials helper;;
 		cvsexportcommit)  : export;;
 		cvsimport)        : import;;
 		cvsserver)        : daemon;;

```

## SZEDER Gábor, 2015-05-06 10:26

Subject: Re: [PATCH] completion: remove credential helpers from porcelain commands
Message-ID: <20150506122642.Horde.JpisdKtEAos7MJrZqzdelw4@webmail.informatik.kit.edu>
URL: https://gitlist.dev/e/20150506122642.Horde.JpisdKtEAos7MJrZqzdelw4%40webmail.informatik.kit.edu
In-Reply-To: <xmqqzj5id7v7.fsf@gitster.dls.corp.google.com>

```

Quoting Junio C Hamano <gitster@pobox.com>:

> Jeff King <peff@peff.net> writes:
>
>>> However, if you think filtering out 'credential-*' is the way to go, I'm
>>> happy to reroll.
>>
>> I'd actually be fine with just marking all credential-* as "credentials
>> helper". I think we have staked out the "git-credential-foo" namespace,
>> so anybody putting something unrelated in there deserves what they get.
>> And it makes one fewer list to keep up to date.
>>
>> I _do_ have other git-credential-foo's that should be ignored (and are
>> not in your list), but I am probably the only person in the world (they
>> are due to me experimenting with the credential helper code :) ).
>
> Let's do this on top of the "typofix helper" one, as there was
> another show-stopper typo.  I could also amend the log message
> and declare that we now squat on git-credential-<anything>, but
> I do not think it is necessary.
>
> diff --git a/contrib/completion/git-completion.bash  
> b/contrib/completion/git-completion.bash
> index fdf0ddc..af78212 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -665,13 +665,8 @@ __git_list_porcelain_commands ()
>  		checkout-index)   : plumbing;;
>  		commit-tree)      : plumbing;;
>  		count-objects)    : infrequent;;
> -		credential        : credentials;;
> -		credential-cache) : credentials helper;;
> -		credential-gnome-keyring) : credentials helper;;
> -		credential-netrc) : credentials helper;;
> -		credential-osxkeychain) : credentials helper;;
> -		credential-store) : credentials helper;;
> -		credential-wincred) : credentials helper;;
> +		credential)       : credentials;;
> +		credential-*)     : credentials helper;;
>  		cvsexportcommit)  : export;;
>  		cvsimport)        : import;;
>  		cvsserver)        : daemon;;

Yeah, that's it.

Best,
Gábor

```
