Skip to content

Commit 131f9a1

Browse files
committed
Fix "git-merge -s bogo" help text
It does not make much sense to reuse the output code from "git help" to show the list of commands to the standard output while giving the error message before that to the standard error stream. This makes the output consistent to that of the 1.6.0 version of "git merge". Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 13613ea commit 131f9a1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

builtin-merge.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,17 @@ static struct strategy *get_strategy(const char *name)
110110
}
111111
}
112112
if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
113-
114-
fprintf(stderr, "Could not find merge strategy '%s'.\n\n", name);
115-
list_commands("strategies", longest, &main_cmds, &other_cmds);
113+
fprintf(stderr, "Could not find merge strategy '%s'.\n", name);
114+
fprintf(stderr, "Available strategies are:");
115+
for (i = 0; i < main_cmds.cnt; i++)
116+
fprintf(stderr, " %s", main_cmds.names[i]->name);
117+
fprintf(stderr, ".\n");
118+
if (other_cmds.cnt) {
119+
fprintf(stderr, "Available custom strategies are:");
120+
for (i = 0; i < other_cmds.cnt; i++)
121+
fprintf(stderr, " %s", other_cmds.names[i]->name);
122+
fprintf(stderr, ".\n");
123+
}
116124
exit(1);
117125
}
118126

0 commit comments

Comments
 (0)