git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Renold <martinxyz@gmx.ch>
To: git@vger.kernel.org
Subject: [PATCH] Remove filename from conflict markers
Date: Sun, 28 Jun 2009 17:45:59 +0200	[thread overview]
Message-ID: <20090628154559.GA29049@old.homeip.net> (raw)

Put filenames into the conflict markers only when they are different.
Otherwise they are redundant information clutter.

Signed-off-by: Martin Renold <martinxyz@gmx.ch>
---
 merge-recursive.c             |    9 +++++++--
 t/t3404-rebase-interactive.sh |    4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index c703445..53cad96 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -622,8 +622,13 @@ static int merge_3way(struct merge_options *o,
 	char *name1, *name2;
 	int merge_status;
 
-	name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
-	name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
+	if (strcmp(a->path, b->path)) {
+		name1 = xstrdup(mkpath("%s:%s", branch1, a->path));
+		name2 = xstrdup(mkpath("%s:%s", branch2, b->path));
+	} else {
+		name1 = xstrdup(mkpath("%s", branch1));
+		name2 = xstrdup(mkpath("%s", branch2));
+	}
 
 	fill_mm(one->sha1, &orig);
 	fill_mm(a->sha1, &src1);
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index c32ff66..a973628 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -119,11 +119,11 @@ index e69de29..00750ed 100644
 EOF
 
 cat > expect2 << EOF
-<<<<<<< HEAD:file1
+<<<<<<< HEAD
 2
 =======
 3
->>>>>>> b7ca976... G:file1
+>>>>>>> b7ca976... G
 EOF
 
 test_expect_success 'stop on conflicting pick' '
-- 
1.6.3.1

             reply	other threads:[~2009-06-28 15:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-28 15:45 Martin Renold [this message]
2009-06-30 22:16 ` [PATCH] Remove filename from conflict markers Junio C Hamano
2009-07-01  3:33   ` Nanako Shiraishi
2009-07-01  7:56     ` Martin Renold
2009-07-01  8:36       ` Junio C Hamano
2009-07-01 16:16         ` Martin Renold
2009-07-01 20:18           ` [PATCH/v2] " Martin Renold
2009-07-01 20:57             ` Junio C Hamano

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=20090628154559.GA29049@old.homeip.net \
    --to=martinxyz@gmx.ch \
    --cc=git@vger.kernel.org \
    /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).