summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 08565bd)
raw | patch | inline | side by side (parent: 08565bd)
author | Jeff King <peff@peff.net> | |
Thu, 11 Feb 2010 21:08:15 +0000 (16:08 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 12 Feb 2010 06:11:04 +0000 (22:11 -0800) |
When we have a conflict, we advise the user to do:
git commit -c $sha1
This works fine, but is unnecessarily confusing and annoying
for the user to type, when:
git commit -c $the_thing_you_called_cherry_pick_with
works just as well.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git commit -c $sha1
This works fine, but is unnecessarily confusing and annoying
for the user to type, when:
git commit -c $the_thing_you_called_cherry_pick_with
works just as well.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-revert.c | patch | blob | history |
diff --git a/builtin-revert.c b/builtin-revert.c
index 77e4f4eed37d5ab320b6df95b76f9af776ca2fbb..ad612497a2aba1039ab19976a147738dec100a8a 100644 (file)
--- a/builtin-revert.c
+++ b/builtin-revert.c
static int edit, no_replay, no_commit, mainline, signoff;
static enum { REVERT, CHERRY_PICK } action;
static struct commit *commit;
+static const char *commit_name;
static int allow_rerere_auto;
static const char *me;
const char * const * usage_str =
action == REVERT ? revert_usage : cherry_pick_usage;
unsigned char sha1[20];
- const char *arg;
int noop;
struct option options[] = {
OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
if (parse_options(argc, argv, NULL, options, usage_str, 0) != 1)
usage_with_options(usage_str, options);
- arg = argv[0];
- if (get_sha1(arg, sha1))
- die ("Cannot find '%s'", arg);
+ commit_name = argv[0];
+ if (get_sha1(commit_name, sha1))
+ die ("Cannot find '%s'", commit_name);
commit = lookup_commit_reference(sha1);
if (!commit)
exit(1);
sha1_to_hex(commit->object.sha1));
}
-static char *help_msg(const unsigned char *sha1)
+static char *help_msg(const char *name)
{
struct strbuf helpbuf = STRBUF_INIT;
char *msg = getenv("GIT_CHERRY_PICK_HELP");
strbuf_addf(&helpbuf,
" When committing, use the option '-c %s'\n"
"to retain authorship and message.",
- find_unique_abbrev(sha1, DEFAULT_ABBREV));
+ name);
}
return strbuf_detach(&helpbuf, NULL);
}
if (commit_lock_file(&msg_file) < 0)
die ("Error wrapping up %s", defmsg);
fprintf(stderr, "Automatic %s failed.%s\n",
- me, help_msg(commit->object.sha1));
+ me, help_msg(commit_name));
rerere(allow_rerere_auto);
exit(1);
}