Skip to contentSkip to conversation

Restore use of 'help.format' configuration property in 'git help'

PATCH In review Pat Thoyts 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Pat Thoyts

author
#0 lore raw

PATCH 1/1 Restore use of 'help.format' configuration property in 'git help'

Commit 1cc8af0 "help: use HTML as the default help format on Windows" lost the ability to make use of the help.format config value by forcing the use of a compiled in default if no command-line argument was provided. This commit restores the use of the help.format value if one is available, overriding the compiled default.

---
 builtin/help.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
builtin/help.c +3 -3
index 536d4fd..8f9cd60 100644
@@ -449,10 +449,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 	setup_git_directory_gently(&nongit);
 	git_config(git_help_config, NULL);
 
-	if (parsed_help_format == HELP_FORMAT_NONE)
-		help_format = parse_help_format(DEFAULT_HELP_FORMAT);
-	else
+	if (parsed_help_format != HELP_FORMAT_NONE)
 		help_format = parsed_help_format;
+	if (help_format == HELP_FORMAT_NONE)
+		help_format = parse_help_format(DEFAULT_HELP_FORMAT);
 
 	alias = alias_lookup(argv[0]);
 	if (alias && !is_git_command(argv[0])) {
Signature · 1 line
1.7.11.msysgit.0
#1 lore raw
Quoted 5 lines · Pat Thoyts

Commit 1cc8af0 "help: use HTML as the default help format on Windows" lost the ability to make use of the help.format config value by forcing the use of a compiled in default if no command-line argument was provided. This commit restores the use of the help.format value if one is available, overriding the compiled default.

Of course. Sorry for not catching it earlier.

Quoted 24 lines
---
 builtin/help.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
builtin/help.c +3 -3
index 536d4fd..8f9cd60 100644
@@ -449,10 +449,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
 	setup_git_directory_gently(&nongit);
 	git_config(git_help_config, NULL);
 
-	if (parsed_help_format == HELP_FORMAT_NONE)
-		help_format = parse_help_format(DEFAULT_HELP_FORMAT);
-	else
+	if (parsed_help_format != HELP_FORMAT_NONE)
 		help_format = parsed_help_format;
+	if (help_format == HELP_FORMAT_NONE)
+		help_format = parse_help_format(DEFAULT_HELP_FORMAT);
 
 	alias = alias_lookup(argv[0]);
 	if (alias && !is_git_command(argv[0])) {
#2 lore raw
In reply to Pat Thoyts

Op 22-6-2012 14:48, Pat Thoyts schreef:

Quoted 7 lines

Commit 1cc8af0 "help: use HTML as the default help format on Windows" lost the ability to make use of the help.format config value by forcing the use of a compiled in default if no command-line argument was provided. This commit restores the use of the help.format value if one is available, overriding the compiled default.

Thanks.

Vincent