Skip to content

Commit

Permalink
completion: fix completion of git <TAB><TAB>
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bebarino authored and gitster committed Oct 9, 2009
1 parent b6aaaa4 commit 427e586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ __git_all_commands ()
return
fi
local i IFS=" "$'\n'
for i in $(git help -a|egrep '^ ')
for i in $(git help -a|egrep '^ [a-zA-Z0-9]')
do
case $i in
*--*) : helper pattern;;
Expand Down

0 comments on commit 427e586

Please sign in to comment.