Skip to content

Commit 427e586

Browse files
bebarinogitster
authored andcommitted
completion: fix completion of git <TAB><TAB>
After commit 511a3fc (wrap git's main usage string., 2009-09-12), the bash completion for git commands includes COMMAND and [ARGS] when it shouldn't. Fix this by grepping more strictly for a line with git commands. It's doubtful whether git will ever have commands starting with anything besides numbers and letters so this should be fine. At least by being stricter we'll know when we break the completion earlier. Signed-off-by: Stephen Boyd <[email protected]> Acked-by: Shawn O. Pearce <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6aaaa4 commit 427e586

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ __git_all_commands ()
496496
return
497497
fi
498498
local i IFS=" "$'\n'
499-
for i in $(git help -a|egrep '^ ')
499+
for i in $(git help -a|egrep '^ [a-zA-Z0-9]')
500500
do
501501
case $i in
502502
*--*) : helper pattern;;

0 commit comments

Comments
 (0)