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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Jun 2, 2010 at 07:58 UTC
4b2095622f61e6ab51f03601e5c3c8d71ace5fc7
1 file changed
+4
-4
builtin/revert.c
+4
-4
@@ -239,7 +239,7 @@ static void set_author_ident_env(const char *message)
239
sha1_to_hex(commit->object.sha1));
240
}
241
242
-static char *help_msg(const char *name)
242
+static char *help_msg(void)
243
{
244
struct strbuf helpbuf = STRBUF_INIT;
245
char *msg = getenv("GIT_CHERRY_PICK_HELP");
@@ -255,7 +255,7 @@ static char *help_msg(const char *name)
255
strbuf_addf(&helpbuf, " with: \n"
256
"\n"
257
" git commit -c %s\n",
258
- name);
258
+ sha1_to_hex(commit->object.sha1));
259
}
260
else
261
strbuf_addch(&helpbuf, '.');
@@ -357,7 +357,7 @@ static void do_recursive_merge(struct commit *base, struct commit *next,
357
}
358
write_message(msgbuf, defmsg);
359
fprintf(stderr, "Automatic %s failed.%s\n",
360
- me, help_msg(commit_name));
360
+ me, help_msg());
361
rerere(allow_rerere_auto);
362
exit(1);
363
}
@@ -484,7 +484,7 @@ static int do_pick_commit(void)
484
free_commit_list(remotes);
485
if (res) {
486
fprintf(stderr, "Automatic %s with strategy %s failed.%s\n",
487
- me, strategy, help_msg(commit_name));
487
+ me, strategy, help_msg());
488
rerere(allow_rerere_auto);
489
exit(1);
490
}