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

[PATCH v2 0/9] Support both merge backends in the testsuite, via environment variable

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 26, 2020, 17:01 UTC
Message-ID
<pull.769.v2.git.1603731704.gitgitgadget@gmail.com>
In-Reply-To
<pull.769.git.1603468885.gitgitgadget@gmail.com>

This patch series builds on top of en/dir-rename-tests. It can be applied independent of my "new merge-ort" API series I submitted a couple days ago[1], but this series uses the same environment variable as patch 4 of that series.

As promised, here is a series that makes the testsuite changes needed to simultaneously support both merge backends, keyed off a GIT_TEST_MERGE_ALGORITHM environment variable setting.

NOTE: The tests do not yet pass with GIT_TEST_MERGE_ALGORITHM=ort, because I
haven't submitted the implementation of the merge-ort functions -- yet. I
figured they are useful as a high level overview of the differences in
behavior between the two backends, and thus am providing these before the
implementation.
Changes since v1:
 * Minor tweak to test_expect_merge_algorithm() suggested by Junio
 * Updated a test for portability
 * I had meant to leave the final patch, patch 9, out of the submission.
   But, since I submitted it, update it to match my local version of that
   test with one additional thing checked in the result.

[1] https://lore.kernel.org/git/pull.895.git.git.1603286555.gitgitgadget@gmail.com/

Elijah Newren (9):
  t/: new helper for tests that pass with ort but fail with recursive
  merge tests: expect improved directory/file conflict handling in ort
  t6416: correct expectation for rename/rename(1to2) + directory/file
  t6404, t6423: expect improved rename/delete handling in ort backend
  t6423: expect improved conflict markers labels in the ort backend
  merge tests: expect slight differences in output for recursive vs. ort
  t6423, t6436: note improved ort handling with dirty files
  t6423: note improved ort handling with untracked files
  t6423: add more details about direct resolution of directories
 t/lib-merge.sh                         |  13 +
 t/t6400-merge-df.sh                    |  14 +-
 t/t6402-merge-rename.sh                | 122 ++++-
 t/t6404-recursive-merge.sh             |  14 +-
 t/t6416-recursive-corner-cases.sh      | 200 ++++---
 t/t6422-merge-rename-corner-cases.sh   |  37 +-
 t/t6423-merge-rename-directories.sh    | 706 +++++++++++++++----------
 t/t6426-merge-skip-unneeded-updates.sh |   3 +-
 t/t6430-merge-recursive.sh             |   3 +-
 t/t6436-merge-overwrite.sh             |  18 +-
 t/t6437-submodule-merge.sh             |  25 +-
 t/t7602-merge-octopus-many.sh          |   6 +
 t/t7610-mergetool.sh                   |  32 +-
 13 files changed, 807 insertions(+), 386 deletions(-)
 create mode 100644 t/lib-merge.sh
base-commit: c64432aacda9054459ce550eca95929897c301bd
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-769%2Fnewren%2Ftests-support-both-merge-backends-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-769/newren/tests-support-both-merge-backends-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/769
Range-diff vs v1:
  1:  a8d4825a32 !  1:  f5d3295262 t/: new helper for tests that pass with ort but fail with recursive
     @@ t/lib-merge.sh (new)
      +# Helper functions used by merge tests.
      +
      +test_expect_merge_algorithm () {
     -+	status_for_recursive=$1
     -+	shift
     -+	status_for_ort=$1
     -+	shift
     ++	status_for_recursive=$1 status_for_ort=$2
     ++	shift 2
      +
      +	if test "$GIT_TEST_MERGE_ALGORITHM" = ort
      +	then
  2:  9394d526f1 =  2:  f27f12e8e5 merge tests: expect improved directory/file conflict handling in ort
  3:  1eae84b787 =  3:  38919982c4 t6416: correct expectation for rename/rename(1to2) + directory/file
  4:  554feb2aa7 =  4:  6e47fa19f8 t6404, t6423: expect improved rename/delete handling in ort backend
  5:  5bead7fa0d =  5:  e8a7d6ac81 t6423: expect improved conflict markers labels in the ort backend
  6:  2aa44c1f13 !  6:  4f32450b08 merge tests: expect slight differences in output for recursive vs. ort
     @@ t/t7602-merge-octopus-many.sh: Merge made by the 'recursive' strategy.
       test_expect_success 'merge reduces irrelevant remote heads' '
      +	if test "$GIT_TEST_MERGE_ALGORITHM" = ort
      +	then
     -+		sed -i'' s/recursive/ort/ expected
     ++		mv expected expected.tmp &&
     ++		sed s/recursive/ort/ expected.tmp >expected &&
     ++		rm expected.tmp
      +	fi &&
       	GIT_MERGE_VERBOSITY=0 git merge c4 c5 >actual &&
       	test_i18ncmp expected actual
  7:  9d46cc1ef3 =  7:  c5350fd0ae t6423, t6436: note improved ort handling with dirty files
  8:  436577106e =  8:  6fd224247d t6423: note improved ort handling with untracked files
  9:  2659d1cb98 !  9:  6e308768ff t6423: add more details about direct resolution of directories
     @@ t/t6423-merge-rename-directories.sh: test_expect_merge_algorithm failure success
      +		test_cmp expect actual &&
      +
      +		grep region_enter.*collect_merge_info trace.output >collect &&
     -+		test_line_count = 4 collect
     ++		test_line_count = 4 collect &&
     ++		grep region_enter.*process_entries$ trace.output >process &&
     ++		test_line_count = 2 process
       	)
       '
       
-- 
gitgitgadget
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren via GitGitGadget
Message 22 of 31 in “Support both merge backends in the testsuite, via environment variable”
  1. 0/9 Support both merge backends in the testsuite, via environment variableElijah Newren via GitGitGadget, Oct 23, 2020
  2. 2/9 merge tests: expect improved directory/file conflict handling in ortElijah Newren via GitGitGadget, Oct 23, 2020
  3. Elijah NewrenOct 23, 2020
  4. 3/9 t6416: correct expectation for rename/rename(1to2) + directory/fileElijah Newren via GitGitGadget, Oct 23, 2020
  5. 1/9 t/: new helper for tests that pass with ort but fail with recursiveElijah Newren via GitGitGadget, Oct 23, 2020
  6. Junio C HamanoOct 23, 2020
  7. Elijah NewrenOct 23, 2020
  8. Elijah NewrenOct 23, 2020
  9. Đoàn Trần Công DanhOct 24, 2020
  10. Elijah NewrenOct 24, 2020
  11. Đoàn Trần Công DanhOct 25, 2020
  12. Elijah NewrenOct 26, 2020
  13. Junio C HamanoOct 26, 2020
  14. 4/9 t6404, t6423: expect improved rename/delete handling in ort backendElijah Newren via GitGitGadget, Oct 23, 2020
  15. 5/9 t6423: expect improved conflict markers labels in the ort backendElijah Newren via GitGitGadget, Oct 23, 2020
  16. 6/9 merge tests: expect slight differences in output for recursive vs. ortElijah Newren via GitGitGadget, Oct 23, 2020
  17. Elijah NewrenOct 24, 2020
  18. 9/9 t6423: add more details about direct resolution of directoriesElijah Newren via GitGitGadget, Oct 23, 2020
  19. Elijah NewrenOct 23, 2020
  20. 7/9 t6423, t6436: note improved ort handling with dirty filesElijah Newren via GitGitGadget, Oct 23, 2020
  21. 8/9 t6423: note improved ort handling with untracked filesElijah Newren via GitGitGadget, Oct 23, 2020
  22. 0/9 Support both merge backends in the testsuite, via environment variableElijah Newren via GitGitGadget, Oct 26, 2020
  23. 7/9 t6423, t6436: note improved ort handling with dirty filesElijah Newren via GitGitGadget, Oct 26, 2020
  24. 9/9 t6423: add more details about direct resolution of directoriesElijah Newren via GitGitGadget, Oct 26, 2020
  25. 8/9 t6423: note improved ort handling with untracked filesElijah Newren via GitGitGadget, Oct 26, 2020
  26. 6/9 merge tests: expect slight differences in output for recursive vs. ortElijah Newren via GitGitGadget, Oct 26, 2020
  27. 5/9 t6423: expect improved conflict markers labels in the ort backendElijah Newren via GitGitGadget, Oct 26, 2020
  28. 4/9 t6404, t6423: expect improved rename/delete handling in ort backendElijah Newren via GitGitGadget, Oct 26, 2020
  29. 2/9 merge tests: expect improved directory/file conflict handling in ortElijah Newren via GitGitGadget, Oct 26, 2020
  30. 1/9 t/: new helper for tests that pass with ort but fail with recursiveElijah Newren via GitGitGadget, Oct 26, 2020
  31. 3/9 t6416: correct expectation for rename/rename(1to2) + directory/fileElijah Newren via GitGitGadget, Oct 26, 2020

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.