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

A merge-ort TODO comment, and how to test merge-ort?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 4, 2021, 16:28 UTC
Message-ID
<877dmmkhnt.fsf@evledraar.gmail.com>
In-Reply-To
<69129a20edcfb57a3278285f31584ffcc2b3bad7.1609468488.git.gitgitgadget@gmail.com>
On Fri, Jan 01 2021, Elijah Newren via GitGitGadget wrote:
Show 19 quoted lines
> +	else {
> +		/* must be the 100644/100755 case */
> +		assert(S_ISREG(a->mode));
> +		result->mode = a->mode;
> +		clean = (b->mode == o->mode);
> +		/*
> +		 * FIXME: If opt->priv->call_depth && !clean, then we really
> +		 * should not make result->mode match either a->mode or
> +		 * b->mode; that causes t6036 "check conflicting mode for
> +		 * regular file" to fail.  It would be best to use some other
> +		 * mode, but we'll confuse all kinds of stuff if we use one
> +		 * where S_ISREG(result->mode) isn't true, and if we use
> +		 * something like 0100666, then tree-walk.c's calls to
> +		 * canon_mode() will just normalize that to 100644 for us and
> +		 * thus not solve anything.
> +		 *
> +		 * Figure out if there's some kind of way we can work around
> +		 * this...
> +		 */
So if tree-walk.c didn't call canon_mode() you would do:
    if (opt->priv->call_depth && !clean)
        result->mode = 0100666;
    else
        result->mode = a->mode;

I haven't looked at this bit closer, but that doesn't make the test referenced here pass.

I'm refactoring tree-walk.h to do that in a WIP series, and ran into this.

As an aside, how does one run the merge-ort tests in such a way as
they'll pass on master now? There's now a bunch of failures with
GIT_TEST_MERGE_ALGORITHM=ort, well, just for t*merge*.sh:
    
    t6409-merge-subtree.sh                        (Wstat: 256 Tests: 12 Failed: 1)
      Failed test:  12
      Non-zero exit status: 1
    t6418-merge-text-auto.sh                      (Wstat: 256 Tests: 10 Failed: 3)
      Failed tests:  4-5, 10
      Non-zero exit status: 1
    t6437-submodule-merge.sh                      (Wstat: 0 Tests: 18 Failed: 0)
      TODO passed:   13, 17
    t6423-merge-rename-directories.sh             (Wstat: 256 Tests: 68 Failed: 4)
      Failed tests:  7, 53, 55, 59
      Non-zero exit status: 1
And both test_expect_merge_algorithm and what seems to be a common
pattern of e.g.:
    
    t6400-merge-df.sh:      if test "$GIT_TEST_MERGE_ALGORITHM" = ort
    t6400-merge-df.sh-      then
    t6400-merge-df.sh-              test 0 -eq $(git ls-files -o | wc -l)
    t6400-merge-df.sh-      else
    t6400-merge-df.sh-              test 1 -eq $(git ls-files -o | wc -l)
    t6400-merge-df.sh-      fi &&

Will not run tests on both backends, I was expecting to find something so we can the test N times for the backends, and declared if things were to be skipped on ort or whatever.

I understand that this is still WIP code, but it would be nice to have it in a state where one can confidently touch merge-ort.c when changing some API or whatever and have it be tested by default.

Or maybe that's the case, and I've missed how it's happening...
Previous: Elijah Newren via GitGitGadgetNext: Elijah Newren
Message 23 of 37 in “merge-ort: add more handling of basic conflict types”
  1. 00/10 merge-ort: add more handling of basic conflict typesElijah Newren via GitGitGadget, Dec 18, 2020
  2. 01/10 merge-ort: handle D/F conflict where directory disappears due to mergeElijah Newren via GitGitGadget, Dec 18, 2020
  3. Derrick StoleeDec 30, 2020
  4. Elijah NewrenDec 30, 2020
  5. Derrick StoleeDec 31, 2020
  6. Elijah NewrenDec 31, 2020
  7. 03/10 merge-ort: implement unique_path() helperElijah Newren via GitGitGadget, Dec 18, 2020
  8. Derrick StoleeDec 30, 2020
  9. Elijah NewrenDec 30, 2020
  10. Derrick StoleeDec 31, 2020
  11. 04/10 merge-ort: handle book-keeping around two- and three-way content mergeElijah Newren via GitGitGadget, Dec 18, 2020
  12. 02/10 merge-ort: handle directory/file conflicts that remainElijah Newren via GitGitGadget, Dec 18, 2020
  13. 05/10 merge-ort: flesh out implementation of handle_content_merge()Elijah Newren via GitGitGadget, Dec 18, 2020
  14. 07/10 merge-ort: copy and adapt merge_submodule() from merge-recursive.cElijah Newren via GitGitGadget, Dec 18, 2020
  15. 09/10 merge-ort: copy find_first_merges() implementation from merge-recursive.cElijah Newren via GitGitGadget, Dec 18, 2020
  16. 10/10 merge-ort: add handling for different types of files at same pathElijah Newren via GitGitGadget, Dec 18, 2020
  17. 06/10 merge-ort: copy and adapt merge_3way() from merge-recursive.cElijah Newren via GitGitGadget, Dec 18, 2020
  18. 08/10 merge-ort: implement format_commit()Elijah Newren via GitGitGadget, Dec 18, 2020
  19. Elijah NewrenDec 29, 2020
  20. 00/10 merge-ort: add more handling of basic conflict typesElijah Newren via GitGitGadget, Jan 1, 2021
  21. 01/10 merge-ort: handle D/F conflict where directory disappears due to mergeElijah Newren via GitGitGadget, Jan 1, 2021
  22. 05/10 merge-ort: flesh out implementation of handle_content_merge()Elijah Newren via GitGitGadget, Jan 1, 2021
  23. A merge-ort TODO comment, and how to test merge-ort?Ævar Arnfjörð Bjarmason, Mar 4, 2021
  24. Elijah NewrenMar 4, 2021
  25. Ævar Arnfjörð BjarmasonMar 4, 2021
  26. Elijah NewrenMar 4, 2021
  27. Ævar Arnfjörð BjarmasonMar 8, 2021
  28. 03/10 merge-ort: implement unique_path() helperElijah Newren via GitGitGadget, Jan 1, 2021
  29. 04/10 merge-ort: handle book-keeping around two- and three-way content mergeElijah Newren via GitGitGadget, Jan 1, 2021
  30. 07/10 merge-ort: copy and adapt merge_submodule() from merge-recursive.cElijah Newren via GitGitGadget, Jan 1, 2021
  31. 02/10 merge-ort: handle directory/file conflicts that remainElijah Newren via GitGitGadget, Jan 1, 2021
  32. 09/10 merge-ort: copy find_first_merges() implementation from merge-recursive.cElijah Newren via GitGitGadget, Jan 1, 2021
  33. 08/10 merge-ort: implement format_commit()Elijah Newren via GitGitGadget, Jan 1, 2021
  34. 10/10 merge-ort: add handling for different types of files at same pathElijah Newren via GitGitGadget, Jan 1, 2021
  35. 06/10 merge-ort: copy and adapt merge_3way() from merge-recursive.cElijah Newren via GitGitGadget, Jan 1, 2021
  36. Derrick StoleeJan 5, 2021
  37. Elijah NewrenJan 6, 2021

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.