@matheusbsbs / matheus-bagliano / commits / d5be89d8ad
Fork 0

git-revert: record the parent against which a revert was made

As described in Documentation/howto/revert-a-faulty-merge.txt, re-merging from a previously reverted a merge of a side branch may need a revert of the revert beforehand. Record against which parent the revert was made in the commit, so that later the user can figure out what went on. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Robin Rosenberg committed Dec 21, 2008 at 14:17 UTC d5be89d8ad88792a9716fbfdb499d6d852d0eff5
1 file changed +5
builtin-revert.c
+5
@@ -352,6 +352,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
352 add_to_msg(oneline_body + 1);
353 add_to_msg("\"\n\nThis reverts commit ");
354 add_to_msg(sha1_to_hex(commit->object.sha1));
355 +
356 + if (commit->parents->next) {
357 + add_to_msg(", reversing\nchanges made to ");
358 + add_to_msg(sha1_to_hex(parent->object.sha1));
359 + }
360 add_to_msg(".\n");
361 } else {
362 base = parent;