cherry-pick/revert: Use error() for failure message
When cherry-pick fails after picking a large series of commits, it can be hard to pick out the error message and advice. Clarify the error and prefix it with “error: ” to help. Before: Automatic cherry-pick failed. [...advice...] After: error: could not apply 7ab78c9... Do something neat. [...advice...] Noticed-by: Thomas Rast <trast@student.ethz.ch> Encouraged-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Aug 11, 2010 at 03:37 UTC
981ff5c37ae20687c98d98c8689d5e89016026d2
1 file changed
+5
-2
builtin/revert.c
+5
-2
@@ -524,8 +524,11 @@ static int do_pick_commit(void)
524
}
525
526
if (res) {
527
- fprintf(stderr, "Automatic %s failed.%s\n",
528
- mebuf.buf, help_msg());
527
+ error("could not %s %s... %s",
528
+ action == REVERT ? "revert" : "apply",
529
+ find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),
530
+ msg.subject);
531
+ fprintf(stderr, help_msg());
532
rerere(allow_rerere_auto);
533
} else {
534
if (!no_commit)