From 981ff5c37ae20687c98d98c8689d5e89016026d2 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 11 Aug 2010 03:37:24 -0500 Subject: [PATCH] cherry-pick/revert: Use error() for failure message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Encouraged-by: Sverre Rabbelier Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/revert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builtin/revert.c b/builtin/revert.c index 74c1581fdc..9a7483b66f 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -524,8 +524,11 @@ static int do_pick_commit(void) } if (res) { - fprintf(stderr, "Automatic %s failed.%s\n", - mebuf.buf, help_msg()); + error("could not %s %s... %s", + action == REVERT ? "revert" : "apply", + find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV), + msg.subject); + fprintf(stderr, help_msg()); rerere(allow_rerere_auto); } else { if (!no_commit) -- 2.47.1