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>
This commit is contained in:
Jonathan Nieder 2010-08-11 03:37:24 -05:00 коммит произвёл Junio C Hamano
Родитель 2a41dfb03b
Коммит 981ff5c37a
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -524,8 +524,11 @@ static int do_pick_commit(void)
} }
if (res) { if (res) {
fprintf(stderr, "Automatic %s failed.%s\n", error("could not %s %s... %s",
mebuf.buf, help_msg()); action == REVERT ? "revert" : "apply",
find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),
msg.subject);
fprintf(stderr, help_msg());
rerere(allow_rerere_auto); rerere(allow_rerere_auto);
} else { } else {
if (!no_commit) if (!no_commit)