git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Remove filename from conflict markers
@ 2009-06-28 15:45 Martin Renold
  2009-06-30 22:16 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Renold @ 2009-06-28 15:45 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-01 20:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-28 15:45 [PATCH] Remove filename from conflict markers Martin Renold
2009-06-30 22:16 ` 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

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).