git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Dec 20, 2008, 07:08 UTC
Message-ID
<200812200808.02011.robin.rosenberg.lists@dewire.com>
In-Reply-To
<200812182039.15169.bss@iguanasuicide.net>
fredag 19 december 2008 03:39:15 skrev Boyd Stephen Smith Jr.:
Show 5 quoted lines
> Signed-off-by: Boyd Stephen Smith Jr <bss@iguanasuicide.net>
> ---
> On Thursday 2008 December 18 18:21:25 Linus Torvalds wrote:
> > 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 <robin.rosenberg@dewire.com>
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 <robin.rosenberg@dewire.com>
---
 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
Previous: Boyd Stephen Smith Jr.Next: Boyd Stephen Smith Jr.
Message 10 of 24 in “Make git revert warn the user when reverting a merge commit.”
  1. Make git revert warn the user when reverting a merge commit.Boyd Stephen Smith Jr., Dec 19, 2008
  2. Johannes SchindelinDec 19, 2008
  3. Junio C HamanoDec 19, 2008
  4. Boyd Stephen Smith Jr.Dec 19, 2008
  5. Jay SoffianDec 19, 2008
  6. Boyd Stephen Smith Jr.Dec 19, 2008
  7. Junio C HamanoDec 19, 2008
  8. AlanDec 19, 2008
  9. Boyd Stephen Smith Jr.Dec 19, 2008
  10. Robin RosenbergDec 20, 2008
  11. Boyd Stephen Smith Jr.Dec 20, 2008
  12. Robin RosenbergDec 20, 2008
  13. Junio C HamanoDec 21, 2008
  14. Boyd Stephen Smith Jr.Dec 21, 2008
  15. Robin RosenbergDec 21, 2008
  16. Junio C HamanoDec 21, 2008
  17. Boyd Stephen Smith Jr.Dec 21, 2008
  18. Junio C HamanoDec 21, 2008
  19. Boyd Stephen Smith Jr.Dec 21, 2008
  20. Junio C HamanoDec 21, 2008
  21. Junio C HamanoDec 21, 2008
  22. Robin RosenbergDec 21, 2008
  23. Junio C HamanoDec 21, 2008
  24. Robin RosenbergDec 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.