git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Sjors Gielen <dazjorz@dazjorz.com>
Cc: git@vger.kernel.org, Diederik van der Boor <vdboor@codindomain.com>
Subject: [PATCH] merge-recursive: demonstrate an incorrect conflict with submodule
Date: Tue, 08 Jun 2010 13:34:12 +0200	[thread overview]
Message-ID: <4C0E2AB4.2010008@viscovery.net> (raw)
In-Reply-To: <4C0DDBC8.9030909@viscovery.net>

From: Johannes Sixt <j6t@kdbg.org>

When one side of a merge turns a directory into a submodule, and the other
side does not touch that directory (but has other non-conflicting changes),
then a merge should succeed. But currently, it does not; it rather fails
with a file/directory conflict.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 6/8/2010 7:57, schrieb Johannes Sixt:
> The *only* curious thing after your cherry-pick is this:
> 
>> #	added by us:        contrib/isf-qt
> 
> because contrib/isf-qt is not touched by the commit that you are
> cherry-picking.

Here's a test case that exhibits the bug in merge-recursive;
at least, I think it is a bug.

-- Hannes

 t/t3030-merge-recursive.sh |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh
index 9929f82..9eae6e9 100755
--- a/t/t3030-merge-recursive.sh
+++ b/t/t3030-merge-recursive.sh
@@ -22,6 +22,7 @@ test_expect_success 'setup 1' '
 	git branch df-2 &&
 	git branch df-3 &&
 	git branch remove &&
+	git branch submod &&
 
 	echo hello >>a &&
 	cp a d/e &&
@@ -236,6 +237,17 @@ test_expect_success 'setup 6' '
 	test_cmp expected actual
 '
 
+test_expect_success 'setup 7' '
+
+	git checkout submod &&
+	git rm d/e &&
+	test_tick &&
+	git commit -m "remove d/e" &&
+	git update-index --add --cacheinfo 160000 $c1 d &&
+	test_tick &&
+	git commit -m "make d/ a submodule"
+'
+
 test_expect_success 'merge-recursive simple' '
 
 	rm -fr [abcd] &&
@@ -551,4 +563,21 @@ test_expect_success 'merge removes empty directories' '
 	test_must_fail test -d d
 '
 
+test_expect_failure 'merge-recursive simple w/submodule' '
+
+	git checkout submod &&
+	git merge remove
+'
+
+test_expect_failure 'merge-recursive simple w/submodule result' '
+
+	git ls-files -s >actual &&
+	(
+		echo "100644 $o5 0	a"
+		echo "100644 $o0 0	c"
+		echo "100644 $c1 0	d"
+	) >expected &&
+	test_cmp expected actual
+'
+
 test_done
-- 
1.7.1.75.g68e2c

  reply	other threads:[~2010-06-08 11:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 22:46 Merging a commit from a distant branch, cherry-pick seems to fail Sjors Gielen
2010-06-08  5:57 ` Johannes Sixt
2010-06-08 11:34   ` Johannes Sixt [this message]
2010-06-08 11:58     ` [PATCH] merge-recursive: demonstrate an incorrect conflict with submodule Johannes Sixt

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=4C0E2AB4.2010008@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=dazjorz@dazjorz.com \
    --cc=git@vger.kernel.org \
    --cc=vdboor@codindomain.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).