git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] completion: fix completion of git <TAB><TAB>
@ 2009-10-09  6:21 Stephen Boyd
  2009-10-09  6:21 ` [PATCHv2 2/2] completion: fix alias listings with newlines Stephen Boyd
  2009-10-09 14:26 ` [PATCH 1/2] completion: fix completion of git <TAB><TAB> Shawn O. Pearce
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Boyd @ 2009-10-09  6:21 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git, Johannes Sixt

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 <bebarino@gmail.com>
---

 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 88b1b3c..652a47c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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;;
-- 
1.6.5.rc3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-09 14:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-09  6:21 [PATCH 1/2] completion: fix completion of git <TAB><TAB> Stephen Boyd
2009-10-09  6:21 ` [PATCHv2 2/2] completion: fix alias listings with newlines Stephen Boyd
2009-10-09 14:29   ` Shawn O. Pearce
2009-10-09 14:26 ` [PATCH 1/2] completion: fix completion of git <TAB><TAB> Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).