提交 981ff5c3 编写于 作者: J Jonathan Nieder 提交者: Junio C Hamano

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: NThomas Rast <trast@student.ethz.ch>
Encouraged-by: NSverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 2a41dfb0
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册