{"thread":{"id":"21810","subject":"[PATCH] help: Do not unnecessarily look for a repository","startedAt":"2009-12-01T19:27:34Z","lastAt":"2009-12-01T19:27:34Z","messageCount":1,"participants":["David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"128920","messageId":"1259695654-3182-1-git-send-email-davvid@gmail.com","threadId":"21810","inReplyTo":null,"subject":"[PATCH] help: Do not unnecessarily look for a repository","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-12-01T19:27:34Z","receivedAt":"2009-12-01T19:27:34Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Although 'git help' actually doesn't need to be run inside a git\nrepository and uses no repository-specific information, it looks for a git\ndirectory.  Searching for a git directory can be annoying in auto-mount\nenvironments.  With this commit, 'git help' no longer searches for a\nrepository when run without any options.\n\n7c3baa9 originally modified 'git help -a' to not require a repository.\nThis applies the same fix for 'git help'.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n builtin-help.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-help.c b/builtin-help.c\nindex ca08519..09ad4b0 100644\n--- a/builtin-help.c\n+++ b/builtin-help.c\n@@ -427,9 +427,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t\treturn 0;\n \t}\n \n-\tsetup_git_directory_gently(&nongit);\n-\tgit_config(git_help_config, NULL);\n-\n \tif (!argv[0]) {\n \t\tprintf(\"usage: %s\\n\\n\", git_usage_string);\n \t\tlist_common_cmds_help();\n@@ -437,6 +434,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t\treturn 0;\n \t}\n \n+\tsetup_git_directory_gently(&nongit);\n+\tgit_config(git_help_config, NULL);\n+\n \talias = alias_lookup(argv[0]);\n \tif (alias && !is_git_command(argv[0])) {\n \t\tprintf(\"`git %s' is aliased to `%s'\\n\", argv[0], alias);\n-- \n1.6.5.3\n"}]}