From: Gerrit Pape Date: Wed, 28 Oct 2009 09:30:22 GMT Subject: [PATCH] help -a: do not unnecessarily look for a repository Message-ID: <20091028093022.30253.qmail@d8110c1e8cdcdf.315fe32.mid.smarden.org> In-Reply-To: <7viqe0yrnu.fsf@alter.siamese.dyndns.org> Although 'git help -a' actually doesn't need to be run inside a git repository and uses no repository-specific information, it looks for a git directory. On 'git ' the bash completion runs 'git help -a' and unnecessary searching for a git directory can be annoying in auto-mount environments. With this commit, 'git help' no longer searches for a repository when run with the -a option. The fix is from Johannes Schindelin, the annoying behavior has been reported by Vincent Danjean through http://bugs.debian.org/539273 Signed-off-by: Gerrit Pape --- On Tue, Oct 27, 2009 at 11:11:01PM -0700, Junio C Hamano wrote: > Gerrit Pape writes: > > Hi Junio, I suggest to apply this patch from Johannes to master. > Could you help by coming up with a suitable log message? > > It's a bit too much to ask me to hunt for ancient discussion to > correct the <> myself to describe what the > issue was, Sure, sorry for that. Regards, Gerrit. builtin-help.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin-help.c b/builtin-help.c index e1ade8e..ca08519 100644 --- a/builtin-help.c +++ b/builtin-help.c @@ -417,9 +417,6 @@ int cmd_help(int argc, const char **argv, const char *prefix) const char *alias; load_command_list("git-", &main_cmds, &other_cmds); - setup_git_directory_gently(&nongit); - git_config(git_help_config, NULL); - argc = parse_options(argc, argv, prefix, builtin_help_options, builtin_help_usage, 0); @@ -430,6 +427,9 @@ int cmd_help(int argc, const char **argv, const char *prefix) return 0; } + setup_git_directory_gently(&nongit); + git_config(git_help_config, NULL); + if (!argv[0]) { printf("usage: %s\n\n", git_usage_string); list_common_cmds_help(); -- 1.6.5.2