git-revert: Revert revert message to old behaviour
When converting from the shell script, based on a misreading of the sed invocation, the builtin included the abbreviated commit name, and did _not_ include the quotes around the oneline message. This fixes it. [jc: with a fix for the typo/thinko spotted by Linus, and also removing the unwanted abbrev at the beginning.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Johannes Schindelin committed
Mar 23, 2007 at 17:06 UTC
e43b01058222da3fa0ba9b662f6621709a5981b3
1 file changed
+5
-5
builtin-revert.c
+5
-5
@@ -294,13 +294,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)
294
oneline = get_oneline(message);
295
296
if (action == REVERT) {
297
+ char *oneline_body = strchr(oneline, ' ');
298
+
299
base = commit;
300
next = commit->parents->item;
299
- add_to_msg("Revert ");
300
- add_to_msg(find_unique_abbrev(commit->object.sha1,
301
- DEFAULT_ABBREV));
302
- add_to_msg(oneline);
303
- add_to_msg("\nThis reverts commit ");
301
+ add_to_msg("Revert \"");
302
+ add_to_msg(oneline_body + 1);
303
+ add_to_msg("\"\n\nThis reverts commit ");
304
add_to_msg(sha1_to_hex(commit->object.sha1));
305
add_to_msg(".\n");
306
} else {