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

[PATCH 03/12] t6038 (merge.renormalize): check that it can be turned off

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 5, 2010, 11:13 UTC
Message-ID
<20100805111304.GE13779@burratino>
In-Reply-To
<20100805110822.GB13779@burratino>

An unusual sort of person (not me) may even enjoy the conflicts from line-ending changes. But more importantly, it is useful to document that behavior so we can more easily notice if it changes in an uncontrolled way while no one is watching.

Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 t/t6038-merge-text-auto.sh |   50 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)
diff --git a/t/t6038-merge-text-auto.sh b/t/t6038-merge-text-auto.sh
index a7ea4b6..52d0dc4 100755
--- a/t/t6038-merge-text-auto.sh
+++ b/t/t6038-merge-text-auto.sh
@@ -15,7 +15,6 @@ test_description='CRLF merge conflict across text=auto change
 . ./test-lib.sh
 
 test_expect_success setup '
-	git config merge.renormalize true &&
 	git config core.autocrlf false &&
 
 	echo first line | append_cr >file &&
@@ -59,12 +58,19 @@ test_expect_success setup '
 	git checkout master
 '
 
+test_expect_success 'set up fuzz_conflict() helper' '
+	fuzz_conflict() {
+		sed -e "s/^\([<>=]......\) .*/\1/" "$@"
+	}
+'
+
 test_expect_success 'Merge after setting text=auto' '
 	cat <<-\EOF >expected &&
 	first line
 	same line
 	EOF
 
+	git config merge.renormalize true &&
 	git rm -fr . &&
 	rm -f .gitattributes &&
 	git reset --hard a &&
@@ -78,6 +84,7 @@ test_expect_success 'Merge addition of text=auto' '
 	same line
 	EOF
 
+	git config merge.renormalize true &&
 	git rm -fr . &&
 	rm -f .gitattributes &&
 	git reset --hard b &&
@@ -85,12 +92,51 @@ test_expect_success 'Merge addition of text=auto' '
 	test_cmp expected file
 '
 
+test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '
+	q_to_cr <<-\EOF >expected &&
+	<<<<<<<
+	first line
+	same line
+	=======
+	first lineQ
+	same lineQ
+	>>>>>>>
+	EOF
+
+	git config merge.renormalize false &&
+	rm -f .gitattributes &&
+	git reset --hard a &&
+	test_must_fail git merge b &&
+	fuzz_conflict file >file.fuzzy &&
+	test_cmp expected file.fuzzy
+'
+
+test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' '
+	q_to_cr <<-\EOF >expected &&
+	<<<<<<<
+	first lineQ
+	same lineQ
+	=======
+	first line
+	same line
+	>>>>>>>
+	EOF
+
+	git config merge.renormalize false &&
+	rm -f .gitattributes &&
+	git reset --hard b &&
+	test_must_fail git merge a &&
+	fuzz_conflict file >file.fuzzy &&
+	test_cmp expected file.fuzzy
+'
+
 test_expect_failure 'checkout -m after setting text=auto' '
 	cat <<-\EOF >expected &&
 	first line
 	same line
 	EOF
 
+	git config merge.renormalize true &&
 	git rm -fr . &&
 	rm -f .gitattributes &&
 	git reset --hard initial &&
@@ -105,6 +151,7 @@ test_expect_failure 'checkout -m addition of text=auto' '
 	same line
 	EOF
 
+	git config merge.renormalize true &&
 	git rm -fr . &&
 	rm -f .gitattributes file &&
 	git reset --hard initial &&
@@ -119,6 +166,7 @@ test_expect_failure 'cherry-pick patch from after text=auto was added' '
 	same line
 	EOF
 
+	git config merge.renormalize true &&
 	git rm -fr . &&
 	git reset --hard b &&
 	test_must_fail git cherry-pick a >err 2>&1 &&
-- 
1.7.2.1.544.ga752d.dirty
Previous: Jonathan NiederNext: Jonathan Nieder
Message 19 of 35 in “Merge renormalization, config renamed”
  1. 0/3 Merge renormalization, config renamedEyvind Bernhardsen, Jul 2, 2010
  2. 1/3 Avoid conflicts when merging branches with mixed normalizationEyvind Bernhardsen, Jul 2, 2010
  3. 2/3 Try normalizing files to avoid delete/modify conflicts when mergingEyvind Bernhardsen, Jul 2, 2010
  4. 3/3 Don't expand CRLFs when normalizing text during mergeEyvind Bernhardsen, Jul 2, 2010
  5. Junio C HamanoJul 2, 2010
  6. 0/6 merge -XrenormalizeJonathan Nieder, Aug 4, 2010
  7. 1/6 merge-trees: push choice to renormalize away from low levelJonathan Nieder, Aug 4, 2010
  8. 2/6 merge-trees: let caller decide whether to renormalizeJonathan Nieder, Aug 4, 2010
  9. 3/6 ll-merge: let caller decide whether to renormalizeJonathan Nieder, Aug 4, 2010
  10. Junio C HamanoAug 4, 2010
  11. 4/6 rerere: migrate to parse-options APIJonathan Nieder, Aug 4, 2010
  12. 5/6 rerere: let caller decide whether to renormalizeJonathan Nieder, Aug 4, 2010
  13. Junio C HamanoAug 4, 2010
  14. 0/12 Re: rerere: let caller decide whether to renormalizeJonathan Nieder, Aug 5, 2010
  15. 01/12 t6038 (merge.renormalize): style nitpicksJonathan Nieder, Aug 5, 2010
  16. Ævar Arnfjörð BjarmasonAug 5, 2010
  17. Jonathan NiederAug 5, 2010
  18. 02/12 t6038 (merge.renormalize): try checkout -m and cherry-pickJonathan Nieder, Aug 5, 2010
  19. 03/12 t6038 (merge.renormalize): check that it can be turned offJonathan Nieder, Aug 5, 2010
  20. 04/12 merge-trees: push choice to renormalize away from low levelJonathan Nieder, Aug 5, 2010
  21. 05/12 merge-trees: let caller decide whether to renormalizeJonathan Nieder, Aug 5, 2010
  22. 06/12 Documentation/technical: document ll_mergeJonathan Nieder, Aug 5, 2010
  23. 07/12 ll-merge: make flag easier to populateJonathan Nieder, Aug 5, 2010
  24. Bert WesargAug 5, 2010
  25. Jonathan NiederAug 5, 2010
  26. Bert WesargAug 5, 2010
  27. Jonathan NiederAug 5, 2010
  28. 08/12 ll-merge: let caller decide whether to renormalizeJonathan Nieder, Aug 5, 2010
  29. 09/12 t4200 (rerere): modernize styleJonathan Nieder, Aug 5, 2010
  30. 10/12 rerere: migrate to parse-options APIJonathan Nieder, Aug 5, 2010
  31. 11/12 rerere: never renormalizeJonathan Nieder, Aug 5, 2010
  32. 12/12 merge-recursive --renormalizeJonathan Nieder, Aug 5, 2010
  33. Eyvind BernhardsenAug 5, 2010
  34. 6/6 merge-recursive: add -Xrenormalize optionJonathan Nieder, Aug 4, 2010
  35. Junio C HamanoAug 4, 2010

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.