revert/cherry-pick: do not mention the original ref
When you cherry-pick or revert a commit, naming it with an annotated tag, we added a comment, attempting to repeat what we got from the end user, to the message. But this was inconsistent. When we got "cherry-pick branch", we recorded the object name (40-letter SHA-1) without saying anything like "original was 'branch'". There was no need to. Also recent rewrite to use parse-options made it impossible to parrot the original command line without "unparsing". This removes the code that implements the misguided "we dereferenced the tag so record that in the commit message" behaviour. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Nov 25, 2007 at 15:15 UTC
757f58ed380a17225e8de9f461083a21d0a2c97c
1 file changed
+1
-13
builtin-revert.c
+1
-13
@@ -30,7 +30,7 @@ static const char * const cherry_pick_usage[] = {
30
NULL
31
};
32
33
-static int edit, no_replay, no_commit, needed_deref, mainline;
33
+static int edit, no_replay, no_commit, mainline;
34
static enum { REVERT, CHERRY_PICK } action;
35
static struct commit *commit;
36
@@ -66,7 +66,6 @@ static void parse_args(int argc, const char **argv)
66
if (commit->object.type == OBJ_TAG) {
67
commit = (struct commit *)
68
deref_tag((struct object *)commit, arg, strlen(arg));
69
- needed_deref = 1;
69
}
70
if (commit->object.type != OBJ_COMMIT)
71
die ("'%s' does not point to a commit", arg);
@@ -333,17 +332,6 @@ static int revert_or_cherry_pick(int argc, const char **argv)
332
add_to_msg(")\n");
333
}
334
}
336
- if (needed_deref) {
337
- add_to_msg("(original 'git ");
338
- add_to_msg(me);
339
- add_to_msg("' arguments: ");
340
- for (i = 0; i < argc; i++) {
341
- if (i)
342
- add_to_msg(" ");
343
- add_to_msg(argv[i]);
344
- }
345
- add_to_msg(")\n");
346
- }
335
336
if (merge_recursive(sha1_to_hex(base->object.sha1),
337
sha1_to_hex(head), "HEAD",