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

[PATCH v3 4/4] test: document broken merge.conflictStyle handling

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 10, 2023, 21:37 UTC
Message-ID
<20230510213738.505241-5-felipe.contreras@gmail.com>
In-Reply-To
<20230510213738.505241-1-felipe.contreras@gmail.com>

Currently both merge.conflictStyle and --conflict=diff3 don't work together for `git commit --merge`, since the former wrongly overrides the later.

There is no easy way to fix this, so mark it as broken for now.
Signee-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t6440-config-conflict-markers.sh | 31 ++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
diff --git a/t/t6440-config-conflict-markers.sh b/t/t6440-config-conflict-markers.sh
index c51512ced6..3ba993a6a8 100755
--- a/t/t6440-config-conflict-markers.sh
+++ b/t/t6440-config-conflict-markers.sh
@@ -82,4 +82,35 @@ test_expect_success 'notes' '
 	)
 '
 
+test_expect_failure 'checkout' '
+	test_create_repo checkout &&
+	(
+		test_commit checkout &&
+
+		test_write_lines a b c d e >content &&
+		git add content &&
+		git commit -m initial &&
+
+		git checkout -b simple master &&
+		test_write_lines a c e >content &&
+		git commit -a -m simple &&
+
+		test_write_lines b d >content &&
+		git checkout --merge master &&
+		! grep "^|||||||" content &&
+
+		git config merge.conflictstyle merge &&
+
+		git checkout -f simple &&
+		test_write_lines b d >content &&
+		git checkout --merge --conflict=diff3 master &&
+		grep "^|||||||" content &&
+
+		git checkout -f simple &&
+		test_write_lines b d >content &&
+		git checkout --merge --conflict=merge master &&
+		! grep "^|||||||" content
+	)
+'
+
 test_done
-- 
2.40.0+fc1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 5 in “Generic conflict style fixes”
  1. 0/4 Generic conflict style fixesFelipe Contreras, May 10, 2023
  2. 1/4 test: add merge style config testFelipe Contreras, May 10, 2023
  3. 2/4 merge-tree: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023
  4. 4/4 test: document broken merge.conflictStyle handlingFelipe Contreras, May 10, 2023
  5. 3/4 notes: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023

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.