Skip to content

Commit

Permalink
cherry-pick/revert: Use error() for failure message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Aug 16, 2010
1 parent 2a41dfb commit 981ff5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions builtin/revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 981ff5c

Please sign in to comment.