Re: [PATCH 2/2] git-completion.bash: prevent 'git help' from searching for git repository
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 4, 2009, 10:22 UTC
- Message-ID
- <alpine.DEB.1.00.0909041217370.4605@intel-tinevez-2-302>
- In-Reply-To
- <20090904092929.23208.qmail@00cf3567a0e8b4.315fe32.mid.smarden.org>
Hi,
On Fri, 4 Sep 2009, Gerrit Pape wrote:
> On 'git <TAB><TAB>' the bash completion runs 'git help -a'.
Correct me if I am wrong, but does "git help -a" not list aliases? If it does, "git help" must search for the Git repository.
If it does not, then "git help" needs fixing, not the completions. I.e. something like this:
-- snipsnap -- [PATCH] git help -a: do not look for a repository
<all the acknowledgements go here>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
builtin-help.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-help.c b/builtin-help.c index e1eba77..719aa23 100644 --- a/builtin-help.c +++ b/builtin-help.c @@ -416,9 +416,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); @@ -429,6 +426,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();