git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-completion.bash: prevent 'git help' from searching for git repository
@ 2009-09-02  9:58 Gerrit Pape
  2009-09-02 11:47 ` Sverre Rabbelier
  0 siblings, 1 reply; 17+ messages in thread
From: Gerrit Pape @ 2009-09-02  9:58 UTC (permalink / raw)
  To: Junio C Hamano, git

On 'git <TAB><TAB>' the bash completion runs 'git help -a'.  Since
'git help' actually doesn't need to be run inside a git repository,
this commit uses the option --git-dir=/nonexistent to prevent it
from searching a git directory.  Unnecessary searching for a git
directory can be annoying in auto-mount environments.

The annoying behavior and suggested fix has been reported by Vincent
Danjean through
 http://bugs.debian.org/539273

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 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 bf688e1..d51854a 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -500,7 +500,7 @@ __git_all_commands ()
 		return
 	fi
 	local i IFS=" "$'\n'
-	for i in $(git help -a|egrep '^ ')
+	for i in $(git --git-dir=/nonexistent help -a|egrep '^ ')
 	do
 		case $i in
 		*--*)             : helper pattern;;
-- 
1.6.0.3

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

end of thread, other threads:[~2009-10-28 20:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-02  9:58 [PATCH] git-completion.bash: prevent 'git help' from searching for git repository Gerrit Pape
2009-09-02 11:47 ` Sverre Rabbelier
2009-09-04  9:29   ` [PATCH 1/2] git: add new option --no-git-dir Gerrit Pape
2009-09-04  9:29   ` [PATCH 2/2] git-completion.bash: prevent 'git help' from searching for git repository Gerrit Pape
2009-09-04  9:57     ` Junio C Hamano
2009-09-04 10:22     ` Johannes Schindelin
2009-09-04 11:09       ` Gerrit Pape
2009-09-04 12:35         ` Johannes Schindelin
2009-09-04 12:49           ` Gerrit Pape
2009-09-04 12:52             ` Johannes Schindelin
2009-09-07 19:15               ` Junio C Hamano
2009-10-27 13:30         ` Gerrit Pape
2009-10-28  6:11           ` Junio C Hamano
2009-10-28  9:30             ` [PATCH] help -a: do not unnecessarily look for a repository Gerrit Pape
2009-10-28 20:26               ` Junio C Hamano
2009-09-04  9:43   ` [PATCH] git-completion.bash: prevent 'git help' from searching for git repository Rogan Dawes
2009-09-04 10:32     ` Johannes Schindelin

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).