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

Re: Strange merge failure (would be overwritten by merge / cannot merge)

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 5, 2009, 17:46 UTC
Message-ID
<7vab191dz1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20090904234552.GA43797@gmail.com>
David Aguilar <davvid@gmail.com> writes:
> Does anyone else on the list have any insights?

Yes; the problem does not have anything to do with renames but unfortunately is much deeper. See $gmane/127783.

Here is a reproduction recipe for the lowest-level ingredient of the breakage in "git read-tree -m"that needs to be fixed, before we can start looking at what "git merge-recursive" does incorrectly (if any) and what "git merge" does incorrectly (again, if any).

 t/t1004-read-tree-m-u-wf.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh
index f19b4a2..055bb00 100755
--- a/t/t1004-read-tree-m-u-wf.sh
+++ b/t/t1004-read-tree-m-u-wf.sh
@@ -238,4 +238,27 @@ test_expect_success 'D/F recursive' '
 
 '
 
+################################################################
+
+test_expect_failure 'D/F D-F' '
+	git reset --hard &&
+	git rm -f -r . &&
+
+	mkdir t && echo 1 >t/f && git add t &&
+	git tag ONE $(git write-tree) &&
+
+	echo 3 >t-f && echo 3 >t/f && git add t-f t &&
+	git tag THREE $(git write-tree) &&
+
+	git rm -f -r t &&
+	echo 2 >t && echo 2 >t-f && git add t t-f &&
+	git tag TWO $(git write-tree) &&
+	git commit -a -m TWO &&
+
+	test_must_fail git read-tree -m -u ONE TWO THREE &&
+	git ls-files -u >actual &&
+	grep t/f actual &&
+	grep t-f actual
+'
+
 test_done
Previous: Christoph HaasNext: Junio C Hamano
Message 4 of 16 in “Strange merge failure (would be overwritten by merge / cannot merge)”
  1. Christoph HaasSep 4, 2009
  2. David AguilarSep 4, 2009
  3. Christoph HaasSep 5, 2009
  4. Junio C HamanoSep 5, 2009
  5. Junio C HamanoSep 6, 2009
  6. Junio C HamanoSep 6, 2009
  7. Linus TorvaldsSep 6, 2009
  8. Junio C HamanoSep 6, 2009
  9. Linus TorvaldsSep 6, 2009
  10. Junio C HamanoSep 6, 2009
  11. Linus TorvaldsSep 6, 2009
  12. Linus TorvaldsSep 6, 2009
  13. Junio C HamanoSep 6, 2009
  14. Linus TorvaldsSep 6, 2009
  15. Linus TorvaldsSep 6, 2009
  16. Junio C HamanoSep 6, 2009

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.