summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 13613ea)
raw | patch | inline | side by side (parent: 13613ea)
author | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 Aug 2008 05:07:55 +0000 (22:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 21 Aug 2008 05:57:55 +0000 (22:57 -0700) |
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>
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>
builtin-merge.c | patch | blob | history |
diff --git a/builtin-merge.c b/builtin-merge.c
index 1f9389bfd7913208b4149b6e6a104949b8d10252..3e8db0d383430eaa45fa4ffc4929609efd9932b4 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
}
}
if (!is_in_cmdlist(&main_cmds, name) && !is_in_cmdlist(&other_cmds, name)) {
-
- fprintf(stderr, "Could not find merge strategy '%s'.\n\n", name);
- list_commands("strategies", longest, &main_cmds, &other_cmds);
+ fprintf(stderr, "Could not find merge strategy '%s'.\n", name);
+ fprintf(stderr, "Available strategies are:");
+ for (i = 0; i < main_cmds.cnt; i++)
+ fprintf(stderr, " %s", main_cmds.names[i]->name);
+ fprintf(stderr, ".\n");
+ if (other_cmds.cnt) {
+ fprintf(stderr, "Available custom strategies are:");
+ for (i = 0; i < other_cmds.cnt; i++)
+ fprintf(stderr, " %s", other_cmds.names[i]->name);
+ fprintf(stderr, ".\n");
+ }
exit(1);
}