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>
Junio C Hamano committed
Aug 20, 2008 at 22:07 UTC
131f9a108bba5a8b0bcba072696653ab3199911a
1 file changed
+11
-3
builtin-merge.c
+11
-3
@@ -110,9 +110,17 @@ static struct strategy *get_strategy(const char *name)
110
}
111
}
112
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
+ }
124
exit(1);
125
}
126