Skip to content

Commit d5be89d

Browse files
Robin Rosenberggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 834caf9 commit d5be89d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin-revert.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
352352
add_to_msg(oneline_body + 1);
353353
add_to_msg("\"\n\nThis reverts commit ");
354354
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+
}
355360
add_to_msg(".\n");
356361
} else {
357362
base = parent;

0 commit comments

Comments
 (0)