git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Boyd Stephen Smith Jr." <bss@iguanasuicide.net>,
	Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make git revert warn the user when reverting a merge commit.
Date: Sat, 20 Dec 2008 08:08:01 +0100	[thread overview]
Message-ID: <200812200808.02011.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <200812182039.15169.bss@iguanasuicide.net>

fredag 19 december 2008 03:39:15 skrev Boyd Stephen Smith Jr.:
> 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

  parent reply	other threads:[~2008-12-20  7:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19  2:39 [PATCH] Make git revert warn the user when reverting a merge commit Boyd Stephen Smith Jr.
2008-12-19  2:57 ` Johannes Schindelin
2008-12-19  3:03   ` Junio C Hamano
2008-12-19  3:29     ` Boyd Stephen Smith Jr.
2008-12-19  3:55       ` Jay Soffian
2008-12-19  5:54         ` Boyd Stephen Smith Jr.
2008-12-19  6:35           ` Junio C Hamano
2008-12-19 18:07       ` Alan
2008-12-19  3:24   ` Boyd Stephen Smith Jr.
2008-12-20  7:08 ` Robin Rosenberg [this message]
2008-12-20 22:54   ` Boyd Stephen Smith Jr.
2008-12-20 23:31     ` Robin Rosenberg
2008-12-21  2:37       ` Junio C Hamano
2008-12-21  3:11         ` Boyd Stephen Smith Jr.
2008-12-21 10:09           ` Robin Rosenberg
2008-12-21 10:59             ` Junio C Hamano
2008-12-21 19:59             ` Boyd Stephen Smith Jr.
2008-12-21 20:23               ` Junio C Hamano
2008-12-21 21:13                 ` Boyd Stephen Smith Jr.
2008-12-21 22:17                   ` Junio C Hamano
2008-12-21 22:38                     ` Junio C Hamano
2008-12-21 22:40                     ` Robin Rosenberg
2008-12-21 22:46                       ` Junio C Hamano
2008-12-21 22:56                         ` Robin Rosenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200812200808.02011.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=bss@iguanasuicide.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).