Skip to content

Commit 981ff5c

Browse files
jrngitster
authored andcommitted
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>
1 parent 2a41dfb commit 981ff5c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

builtin/revert.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,11 @@ static int do_pick_commit(void)
524524
}
525525

526526
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());
529532
rerere(allow_rerere_auto);
530533
} else {
531534
if (!no_commit)

0 commit comments

Comments
 (0)