Skip to content

Commit 4b20956

Browse files
chriscoolgitster
authored andcommitted
revert: change help_msg() to take no argument
This is needed because the following commits will make it possible to cherry-pick many commits instead of just one. So it will be possible to pass for example ranges of commits to "git cherry-pick" and this means that it will not be possible to use the arguments passed to "git cherry-pick" in the help message. The help message will have to use the sha1 of the currently processed commit. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7af4659 commit 4b20956

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/revert.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static void set_author_ident_env(const char *message)
239239
sha1_to_hex(commit->object.sha1));
240240
}
241241

242-
static char *help_msg(const char *name)
242+
static char *help_msg(void)
243243
{
244244
struct strbuf helpbuf = STRBUF_INIT;
245245
char *msg = getenv("GIT_CHERRY_PICK_HELP");
@@ -255,7 +255,7 @@ static char *help_msg(const char *name)
255255
strbuf_addf(&helpbuf, " with: \n"
256256
"\n"
257257
" git commit -c %s\n",
258-
name);
258+
sha1_to_hex(commit->object.sha1));
259259
}
260260
else
261261
strbuf_addch(&helpbuf, '.');
@@ -357,7 +357,7 @@ static void do_recursive_merge(struct commit *base, struct commit *next,
357357
}
358358
write_message(msgbuf, defmsg);
359359
fprintf(stderr, "Automatic %s failed.%s\n",
360-
me, help_msg(commit_name));
360+
me, help_msg());
361361
rerere(allow_rerere_auto);
362362
exit(1);
363363
}
@@ -484,7 +484,7 @@ static int do_pick_commit(void)
484484
free_commit_list(remotes);
485485
if (res) {
486486
fprintf(stderr, "Automatic %s with strategy %s failed.%s\n",
487-
me, strategy, help_msg(commit_name));
487+
me, strategy, help_msg());
488488
rerere(allow_rerere_auto);
489489
exit(1);
490490
}

0 commit comments

Comments
 (0)