summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-06-02 07:58:37 +0200
committerJunio C Hamano <gitster@pobox.com>2010-06-02 10:09:52 -0700
commit4b2095622f61e6ab51f03601e5c3c8d71ace5fc7 (patch)
treea586204b6132e513faf9ca42690c486d5522643c
parent7af46595b2667214e98da55ed2f82ce1ac2b404a (diff)
downloadgit-4b2095622f61e6ab51f03601e5c3c8d71ace5fc7.tar.gz
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>
-rw-r--r--builtin/revert.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index c2aee86d1c..aee10692ba 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -239,7 +239,7 @@ static void set_author_ident_env(const char *message)
sha1_to_hex(commit->object.sha1));
}
-static char *help_msg(const char *name)
+static char *help_msg(void)
{
struct strbuf helpbuf = STRBUF_INIT;
char *msg = getenv("GIT_CHERRY_PICK_HELP");
@@ -255,7 +255,7 @@ static char *help_msg(const char *name)
strbuf_addf(&helpbuf, " with: \n"
"\n"
" git commit -c %s\n",
- name);
+ sha1_to_hex(commit->object.sha1));
}
else
strbuf_addch(&helpbuf, '.');
@@ -357,7 +357,7 @@ static void do_recursive_merge(struct commit *base, struct commit *next,
}
write_message(msgbuf, defmsg);
fprintf(stderr, "Automatic %s failed.%s\n",
- me, help_msg(commit_name));
+ me, help_msg());
rerere(allow_rerere_auto);
exit(1);
}
@@ -484,7 +484,7 @@ static int do_pick_commit(void)
free_commit_list(remotes);
if (res) {
fprintf(stderr, "Automatic %s with strategy %s failed.%s\n",
- me, strategy, help_msg(commit_name));
+ me, strategy, help_msg());
rerere(allow_rerere_auto);
exit(1);
}