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

[RFH] 3way still has D/F conflict problems...

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2007, 07:22 UTC
Message-ID
<7vejizmvn8.fsf@assigned-by-dhcp.cox.net>

The four commit series starting at 4c4caaf fixed a few D/F conflict case in merge recursive.

  4c4caaf... Treat D/F conflict entry more carefully in unpack-tree...
  ac7f0f4... merge-recursive: do not barf on "to be removed" entries.
  4d50895... merge-recursive: handle D/F conflict case more carefully.
  885b981... t3030: merge-recursive backend test.

However this ended up regressed the following case (don't bother bisecting, it will point at 4c4caaf).

The test case starts with a tree with a directory at D/, one branch (master) modifies files in it, while the other branch (side) makes a bunch of rename and has a blob at D.A, D, and D0C

Yes, this does not trigger if you change D.A to DxA (anything that does not sort before D/ in the index).

Anybody interested in figuring out how to fix unpack-trees.c without breaking the problem the above series fixed?

---
 t/t3031-df-3way.sh |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)
 create mode 100755 t/t3031-df-3way.sh
diff --git a/t/t3031-df-3way.sh b/t/t3031-df-3way.sh
new file mode 100755
index 0000000..42548d2
--- /dev/null
+++ b/t/t3031-df-3way.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+test_description='D/F conflicting threeway merge'
+
+. ./test-lib.sh
+
+fill () {
+	cnt="$1"
+	shift
+	while test "$cnt" -ge 0
+	do
+		cnt=$(( $cnt - 1 ))
+		for line
+		do
+			echo "$line"
+		done
+	done
+}
+
+T=D
+
+test_expect_success 'setup' '
+
+	mkdir D &&
+	fill 50 "Tis true without lying, certain & most true." >D/A &&
+	fill 50 "The Sun is its father, the moon its mother," >D/B &&
+	fill 50 "the wind hath carried it in its belly, the earth its nourse." >D/C &&
+	git add D/A D/B D/C &&
+	test_tick &&
+	git commit -m "Initial" &&
+
+	git tag initial &&
+	git branch side &&
+
+	echo "It has the Sun for father and the Moon for mother:" >>D/B &&
+	test_tick &&
+	git commit -a -m "master changes in-place" &&
+
+	git checkout side &&
+	echo "Truth! Certainty! That in which there is no doubt!" >D.A &&
+	cat D/A >>D.A &&
+	echo "Its father is the Sun and its mother the Moon." >B &&
+	cat D/B >>B &&
+	mv D/C D0C &&
+	rm -rf D &&
+	mv B $T &&
+	git add D.A $T D0C &&
+	test_tick &&
+	git commit -a -m "side moves and makes changes"
+'
+
+test_expect_success 'threeway' '
+
+	git read-tree -m initial side master
+
+'
+
+test_done
Message 1 of 1 in “[RFH] 3way still has D/F conflict problems...”
  1. Junio C HamanoJul 23, 2007

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.