Thread (10 messages) flat view 10 messages, 4 authors, 2016-06-15

Re: [PATCH] Make git revert warn the user when reverting a merge commit.

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:45:48
Subsystem: the rest · Maintainer: Linus Torvalds

fredag 19 december 2008 03:39:15 skrev Boyd Stephen Smith Jr.:
Signed-off-by: Boyd Stephen Smith Jr <redacted>
---
On Thursday 2008 December 18 18:21:25 Linus Torvalds wrote:
quoted
I suspect we should warn about reverting merges.
Or mention the reverted parent in the commit message since it is not obvious.

-- robin
From e982c8cefcdeefd6e8aabc8c354bed69161f40ee Mon Sep 17 00:00:00 2001
From: Robin Rosenberg <redacted>
Date: Sat, 20 Dec 2008 07:22:39 +0100
Subject: [PATCH] Mention reverted parent in commit message for reverted merge.

Signed-off-by: Robin Rosenberg <redacted>
---
 builtin-revert.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-revert.c b/builtin-revert.c
index 4038b41..fc59229 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -352,6 +352,10 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 		add_to_msg(oneline_body + 1);
 		add_to_msg("\"\n\nThis reverts commit ");
 		add_to_msg(sha1_to_hex(commit->object.sha1));
+		if (commit->parents->next) {
+			add_to_msg(" removing\ncontributions from ");
+			add_to_msg(sha1_to_hex(parent->object.sha1));
+		}
 		add_to_msg(".\n");
 	} else {
 		base = parent;
-- 
1.6.1.rc3.36.g43d5.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help