[PATCH] completion: remove 'help' duplicate from porcelain commands
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- Nov 14, 2012, 00:49 UTC
- Message-ID
- <20121114004930.GT12052@goldbirke>
- In-Reply-To
- <20121113234636.GS12052@goldbirke>
The list of all git commands is computed from the output of 'git help -a', which already includes 'help', so there is no need to explicitly add it once more when computing the list of porcelain commands.
Note that 'help' wasn't actually offered twice because of this, because Bash filters duplicates from possible completion words.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> ---
Show 7 quoted lines
> > > Does the git completion script returns any duplicates at all? > > > > It does. 'help' is returned twice for example. > > Right. Now that you mentioned it, I remember I noticed it a while > ago, too. I even wrote a patch to fix it, but not sure what became of > it. Will try to dig it up.
Here it is. It turns out I wrote it in May this year, but according to gmane and my mailbox never sent it out.
contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index bc0657a2..b7b1a834 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -585,7 +585,7 @@ __git_list_porcelain_commands () { local i IFS=" "$'\n' __git_compute_all_commands - for i in "help" $__git_all_commands + for i in $__git_all_commands do case $i in *--*) : helper pattern;;
-- 1.8.0.128.g441b4b3