git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Collect merge-related tests to t64xx
@ 2020-08-05 16:29 Elijah Newren via GitGitGadget
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  0 siblings, 1 reply; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-05 16:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

The tests for the merge machinery are spread over several places.
Collect them into t64xx for simplicity.  Some notes:

t60[234]*.sh:
  Merge tests started in t602*, overgrew bisect and remote tracking
  tests in t6030, t6040, and t6041, and nearly overtook replace tests
  in t6050.  This made picking out relevant tests that I wanted to run
  in a tighter loop slightly more annoying for years.

t303*.sh:
  These started out as tests for the 'merge-recursive' toplevel command,
  but did not restrict to that and had lots of overlap with the
  underlying merge machinery.
t7405, t7613:
  submodule-specific merge logic started out in submodule.c but was
  moved to merge-recursive.c in commit 18cfc08866 ("submodule.c: move
  submodule merging to merge-recursive.c", 2018-05-15).  Since these
  tests are about the logic found in the merge machinery, moving these
  tests to be with the merge tests makes sense.

t7607, t7609:
  Having tests spread all over the place makes it more likely that
  additional tests related to a certain piece of logic grow in all those
  other places.  Much like t303*.sh, these two tests were about the
  underlying merge machinery rather than outer levels.

Tests that were NOT moved:

t76[01]*.sh:
  Other than the four tests mentioned above, the remaining tests in
  t76[01]*.sh are related to non-recursive merge strategies, parameter
  parsing, and other stuff associated with the highlevel builtin/merge.c
  rather than the recursive merge machinery.

t3[45]*.sh:
  The rebase testcases in t34*.sh also test the merge logic pretty
  heavily; sometimes changes I make only trigger failures in the rebase
  tests.  The rebase tests are already nicely coupled together, though,
  and I didn't want to mess that up.  Similar comments apply for the
  cherry-pick tests in t35*.sh.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
    Collect merge machinery related tests into t64*.sh
    
    Although there are a couple in-flight topics that modify some of these
    tests (en/eol-attr-gotchas and bc/sha-256-part-3), since this commit
    only contains 100% renames, it merges cleanly and automatically with
    both next and seen.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-827%2Fnewren%2Fmerge-test-rename-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-827/newren/merge-test-rename-v1
Pull-Request: https://github.com/git/git/pull/827

 t/{t6020-merge-df.sh => t6400-merge-df.sh}                        | 0
 t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh}      | 0
 t/{t6022-merge-rename.sh => t6402-merge-rename.sh}                | 0
 t/{t6023-merge-file.sh => t6403-merge-file.sh}                    | 0
 t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh}          | 0
 t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh}            | 0
 t/{t6026-merge-attr.sh => t6406-merge-attr.sh}                    | 0
 t/{t6027-merge-binary.sh => t6407-merge-binary.sh}                | 0
 t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh}        | 0
 t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh}              | 0
 t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh}            | 0
 t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh}    | 0
 t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh}                    | 0
 ...6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} | 0
 ...6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} | 0
 ...-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} | 0
 t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh}      | 0
 t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh}          | 0
 t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh}        | 0
 ...-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} | 0
 ...ge-rename-directories.sh => t6423-merge-rename-directories.sh} | 0
 ...ed-index-changes.sh => t6424-merge-unrelated-index-changes.sh} | 0
 t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh}  | 0
 ...p-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} | 0
 ...-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} | 0
 t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh}          | 0
 t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh}          | 0
 ...ve-space-options.sh => t6432-merge-recursive-space-options.sh} | 0
 t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh}            | 0
 ...-rename-options.sh => t6434-merge-recursive-rename-options.sh} | 0
 t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh}                | 0
 t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh}          | 0
 t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh}          | 0
 ...e-submodule.sh => t6438-submodule-directory-file-conflicts.sh} | 0
 t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh}  | 0
 35 files changed, 0 insertions(+), 0 deletions(-)
 rename t/{t6020-merge-df.sh => t6400-merge-df.sh} (100%)
 rename t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh} (100%)
 rename t/{t6022-merge-rename.sh => t6402-merge-rename.sh} (100%)
 rename t/{t6023-merge-file.sh => t6403-merge-file.sh} (100%)
 rename t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh} (100%)
 rename t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh} (100%)
 rename t/{t6026-merge-attr.sh => t6406-merge-attr.sh} (100%)
 rename t/{t6027-merge-binary.sh => t6407-merge-binary.sh} (100%)
 rename t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh} (100%)
 rename t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh} (100%)
 rename t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh} (100%)
 rename t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh} (100%)
 rename t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh} (100%)
 rename t/{t6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} (100%)
 rename t/{t6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} (100%)
 rename t/{t6036-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} (100%)
 rename t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh} (100%)
 rename t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh} (100%)
 rename t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh} (100%)
 rename t/{t6042-merge-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} (100%)
 rename t/{t6043-merge-rename-directories.sh => t6423-merge-rename-directories.sh} (100%)
 rename t/{t6044-merge-unrelated-index-changes.sh => t6424-merge-unrelated-index-changes.sh} (100%)
 rename t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh} (100%)
 rename t/{t6046-merge-skip-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} (100%)
 rename t/{t6047-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} (100%)
 rename t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh} (100%)
 rename t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh} (100%)
 rename t/{t3032-merge-recursive-space-options.sh => t6432-merge-recursive-space-options.sh} (100%)
 rename t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh} (100%)
 rename t/{t3034-merge-recursive-rename-options.sh => t6434-merge-recursive-rename-options.sh} (100%)
 rename t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh} (100%)
 rename t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh} (100%)
 rename t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh} (100%)
 rename t/{t7613-merge-submodule.sh => t6438-submodule-directory-file-conflicts.sh} (100%)
 rename t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh} (100%)

diff --git a/t/t6020-merge-df.sh b/t/t6400-merge-df.sh
similarity index 100%
rename from t/t6020-merge-df.sh
rename to t/t6400-merge-df.sh
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6401-merge-criss-cross.sh
similarity index 100%
rename from t/t6021-merge-criss-cross.sh
rename to t/t6401-merge-criss-cross.sh
diff --git a/t/t6022-merge-rename.sh b/t/t6402-merge-rename.sh
similarity index 100%
rename from t/t6022-merge-rename.sh
rename to t/t6402-merge-rename.sh
diff --git a/t/t6023-merge-file.sh b/t/t6403-merge-file.sh
similarity index 100%
rename from t/t6023-merge-file.sh
rename to t/t6403-merge-file.sh
diff --git a/t/t6024-recursive-merge.sh b/t/t6404-recursive-merge.sh
similarity index 100%
rename from t/t6024-recursive-merge.sh
rename to t/t6404-recursive-merge.sh
diff --git a/t/t6025-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
similarity index 100%
rename from t/t6025-merge-symlinks.sh
rename to t/t6405-merge-symlinks.sh
diff --git a/t/t6026-merge-attr.sh b/t/t6406-merge-attr.sh
similarity index 100%
rename from t/t6026-merge-attr.sh
rename to t/t6406-merge-attr.sh
diff --git a/t/t6027-merge-binary.sh b/t/t6407-merge-binary.sh
similarity index 100%
rename from t/t6027-merge-binary.sh
rename to t/t6407-merge-binary.sh
diff --git a/t/t6028-merge-up-to-date.sh b/t/t6408-merge-up-to-date.sh
similarity index 100%
rename from t/t6028-merge-up-to-date.sh
rename to t/t6408-merge-up-to-date.sh
diff --git a/t/t6029-merge-subtree.sh b/t/t6409-merge-subtree.sh
similarity index 100%
rename from t/t6029-merge-subtree.sh
rename to t/t6409-merge-subtree.sh
diff --git a/t/t6031-merge-filemode.sh b/t/t6411-merge-filemode.sh
similarity index 100%
rename from t/t6031-merge-filemode.sh
rename to t/t6411-merge-filemode.sh
diff --git a/t/t6032-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
similarity index 100%
rename from t/t6032-merge-large-rename.sh
rename to t/t6412-merge-large-rename.sh
diff --git a/t/t6033-merge-crlf.sh b/t/t6413-merge-crlf.sh
similarity index 100%
rename from t/t6033-merge-crlf.sh
rename to t/t6413-merge-crlf.sh
diff --git a/t/t6034-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
similarity index 100%
rename from t/t6034-merge-rename-nocruft.sh
rename to t/t6414-merge-rename-nocruft.sh
diff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
similarity index 100%
rename from t/t6035-merge-dir-to-symlink.sh
rename to t/t6415-merge-dir-to-symlink.sh
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
similarity index 100%
rename from t/t6036-recursive-corner-cases.sh
rename to t/t6416-recursive-corner-cases.sh
diff --git a/t/t6037-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
similarity index 100%
rename from t/t6037-merge-ours-theirs.sh
rename to t/t6417-merge-ours-theirs.sh
diff --git a/t/t6038-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
similarity index 100%
rename from t/t6038-merge-text-auto.sh
rename to t/t6418-merge-text-auto.sh
diff --git a/t/t6039-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
similarity index 100%
rename from t/t6039-merge-ignorecase.sh
rename to t/t6419-merge-ignorecase.sh
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
similarity index 100%
rename from t/t6042-merge-rename-corner-cases.sh
rename to t/t6422-merge-rename-corner-cases.sh
diff --git a/t/t6043-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
similarity index 100%
rename from t/t6043-merge-rename-directories.sh
rename to t/t6423-merge-rename-directories.sh
diff --git a/t/t6044-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh
similarity index 100%
rename from t/t6044-merge-unrelated-index-changes.sh
rename to t/t6424-merge-unrelated-index-changes.sh
diff --git a/t/t6045-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
similarity index 100%
rename from t/t6045-merge-rename-delete.sh
rename to t/t6425-merge-rename-delete.sh
diff --git a/t/t6046-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
similarity index 100%
rename from t/t6046-merge-skip-unneeded-updates.sh
rename to t/t6426-merge-skip-unneeded-updates.sh
diff --git a/t/t6047-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
similarity index 100%
rename from t/t6047-diff3-conflict-markers.sh
rename to t/t6427-diff3-conflict-markers.sh
diff --git a/t/t3030-merge-recursive.sh b/t/t6430-merge-recursive.sh
similarity index 100%
rename from t/t3030-merge-recursive.sh
rename to t/t6430-merge-recursive.sh
diff --git a/t/t3031-merge-criscross.sh b/t/t6431-merge-criscross.sh
similarity index 100%
rename from t/t3031-merge-criscross.sh
rename to t/t6431-merge-criscross.sh
diff --git a/t/t3032-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
similarity index 100%
rename from t/t3032-merge-recursive-space-options.sh
rename to t/t6432-merge-recursive-space-options.sh
diff --git a/t/t3033-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
similarity index 100%
rename from t/t3033-merge-toplevel.sh
rename to t/t6433-merge-toplevel.sh
diff --git a/t/t3034-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
similarity index 100%
rename from t/t3034-merge-recursive-rename-options.sh
rename to t/t6434-merge-recursive-rename-options.sh
diff --git a/t/t3035-merge-sparse.sh b/t/t6435-merge-sparse.sh
similarity index 100%
rename from t/t3035-merge-sparse.sh
rename to t/t6435-merge-sparse.sh
diff --git a/t/t7607-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
similarity index 100%
rename from t/t7607-merge-overwrite.sh
rename to t/t6436-merge-overwrite.sh
diff --git a/t/t7405-submodule-merge.sh b/t/t6437-submodule-merge.sh
similarity index 100%
rename from t/t7405-submodule-merge.sh
rename to t/t6437-submodule-merge.sh
diff --git a/t/t7613-merge-submodule.sh b/t/t6438-submodule-directory-file-conflicts.sh
similarity index 100%
rename from t/t7613-merge-submodule.sh
rename to t/t6438-submodule-directory-file-conflicts.sh
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
similarity index 100%
rename from t/t7609-merge-co-error-msgs.sh
rename to t/t6439-merge-co-error-msgs.sh

base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends
  2020-08-05 16:29 [PATCH] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
@ 2020-08-08 17:01 ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
                     ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren

This series starts preparing the merge related tests to work with multiple
backends: merge-recursive or merge-ort. Further work will be coming.

v1 of this series only had the first patch (which collected merge machinery
related tests into t64*.sh). This series adds 10 more patches, which:

Changes since v1:

 * tighten some testcases so they don't pass with completely wrong results
 * fix various errors in causing many test_expect_failure tests to fail for
   the wrong reasons
 * add clarifying comments or fix various comments
 * make some tests more flexible in handling console output messages
   produced by either backend.
 * I'm curious about portability of the second-to-last patch -- is it safe
   to use backreferences with test_i18n_grep? If not, anyone have
   alternative ideas for handling those needed changes?

The greater flexibility patches at the end of the series also previews some
of the design changes being brought by merge-ort.

Elijah Newren (11):
  Collect merge-related tests to t64xx
  t6418: tighten delete/normalize conflict testcase
  t6422: fix bad check against missing file
  t6416, t6422: fix incorrect untracked file count
  t6423: fix test setup for a couple tests
  t6422: fix multiple errors with the mod6 test expectations
  t6416, t6423: clarify some comments and fix some typos
  t6423: add an explanation about why one of the tests does not pass
  t6422, t6426: be more flexible for add/add conflicts involving renames
  t642[23]: be more flexible for add/add conflicts involving pair
    renames
  t6425: be more flexible with rename/delete conflict messages

 t/{t6020-merge-df.sh => t6400-merge-df.sh}    |  0
 ...ss-cross.sh => t6401-merge-criss-cross.sh} |  0
 ...-merge-rename.sh => t6402-merge-rename.sh} |  0
 ...6023-merge-file.sh => t6403-merge-file.sh} |  0
 ...sive-merge.sh => t6404-recursive-merge.sh} |  0
 ...ge-symlinks.sh => t6405-merge-symlinks.sh} |  0
 ...6026-merge-attr.sh => t6406-merge-attr.sh} |  0
 ...-merge-binary.sh => t6407-merge-binary.sh} |  0
 ...p-to-date.sh => t6408-merge-up-to-date.sh} |  0
 ...erge-subtree.sh => t6409-merge-subtree.sh} |  0
 ...ge-filemode.sh => t6411-merge-filemode.sh} |  0
 ...-rename.sh => t6412-merge-large-rename.sh} |  0
 ...6033-merge-crlf.sh => t6413-merge-crlf.sh} |  0
 ...cruft.sh => t6414-merge-rename-nocruft.sh} |  0
 ...mlink.sh => t6415-merge-dir-to-symlink.sh} |  0
 ...ses.sh => t6416-recursive-corner-cases.sh} |  4 +-
 ...s-theirs.sh => t6417-merge-ours-theirs.sh} |  0
 ...-text-auto.sh => t6418-merge-text-auto.sh} |  3 +-
 ...gnorecase.sh => t6419-merge-ignorecase.sh} |  0
 ....sh => t6422-merge-rename-corner-cases.sh} | 68 +++++++++++--------
 ...s.sh => t6423-merge-rename-directories.sh} | 39 +++++++----
 ...=> t6424-merge-unrelated-index-changes.sh} |  0
 ...delete.sh => t6425-merge-rename-delete.sh} |  3 +-
 ...h => t6426-merge-skip-unneeded-updates.sh} |  2 +-
 ...ers.sh => t6427-diff3-conflict-markers.sh} |  0
 ...-recursive.sh => t6430-merge-recursive.sh} |  0
 ...-criscross.sh => t6431-merge-criscross.sh} |  0
 ...=> t6432-merge-recursive-space-options.sh} |  0
 ...ge-toplevel.sh => t6433-merge-toplevel.sh} |  0
 ...> t6434-merge-recursive-rename-options.sh} |  0
 ...-merge-sparse.sh => t6435-merge-sparse.sh} |  0
 ...-overwrite.sh => t6436-merge-overwrite.sh} |  0
 ...dule-merge.sh => t6437-submodule-merge.sh} |  0
 ...438-submodule-directory-file-conflicts.sh} |  0
 ...r-msgs.sh => t6439-merge-co-error-msgs.sh} |  0
 35 files changed, 71 insertions(+), 48 deletions(-)
 rename t/{t6020-merge-df.sh => t6400-merge-df.sh} (100%)
 rename t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh} (100%)
 rename t/{t6022-merge-rename.sh => t6402-merge-rename.sh} (100%)
 rename t/{t6023-merge-file.sh => t6403-merge-file.sh} (100%)
 rename t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh} (100%)
 rename t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh} (100%)
 rename t/{t6026-merge-attr.sh => t6406-merge-attr.sh} (100%)
 rename t/{t6027-merge-binary.sh => t6407-merge-binary.sh} (100%)
 rename t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh} (100%)
 rename t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh} (100%)
 rename t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh} (100%)
 rename t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh} (100%)
 rename t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh} (100%)
 rename t/{t6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} (100%)
 rename t/{t6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} (100%)
 rename t/{t6036-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} (99%)
 rename t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh} (100%)
 rename t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh} (99%)
 rename t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh} (100%)
 rename t/{t6042-merge-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} (94%)
 rename t/{t6043-merge-rename-directories.sh => t6423-merge-rename-directories.sh} (98%)
 rename t/{t6044-merge-unrelated-index-changes.sh => t6424-merge-unrelated-index-changes.sh} (100%)
 rename t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh} (72%)
 rename t/{t6046-merge-skip-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} (99%)
 rename t/{t6047-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} (100%)
 rename t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh} (100%)
 rename t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh} (100%)
 rename t/{t3032-merge-recursive-space-options.sh => t6432-merge-recursive-space-options.sh} (100%)
 rename t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh} (100%)
 rename t/{t3034-merge-recursive-rename-options.sh => t6434-merge-recursive-rename-options.sh} (100%)
 rename t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh} (100%)
 rename t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh} (100%)
 rename t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh} (100%)
 rename t/{t7613-merge-submodule.sh => t6438-submodule-directory-file-conflicts.sh} (100%)
 rename t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh} (100%)


base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-827%2Fnewren%2Fmerge-test-rename-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-827/newren/merge-test-rename-v2
Pull-Request: https://github.com/git/git/pull/827

Range-diff vs v1:

  1:  3a2b7e9743 =  1:  3a2b7e9743 Collect merge-related tests to t64xx
  -:  ---------- >  2:  621c9a159e t6418: tighten delete/normalize conflict testcase
  -:  ---------- >  3:  7f408b7d40 t6422: fix bad check against missing file
  -:  ---------- >  4:  9ce80f2f94 t6416, t6422: fix incorrect untracked file count
  -:  ---------- >  5:  382d65649d t6423: fix test setup for a couple tests
  -:  ---------- >  6:  56e169b1d8 t6422: fix multiple errors with the mod6 test expectations
  -:  ---------- >  7:  7b534d123a t6416, t6423: clarify some comments and fix some typos
  -:  ---------- >  8:  f2d7e744fc t6423: add an explanation about why one of the tests does not pass
  -:  ---------- >  9:  b4e165eca4 t6422, t6426: be more flexible for add/add conflicts involving renames
  -:  ---------- > 10:  a9a02a0ca5 t642[23]: be more flexible for add/add conflicts involving pair renames
  -:  ---------- > 11:  38f6573511 t6425: be more flexible with rename/delete conflict messages

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v2 01/11] Collect merge-related tests to t64xx
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

The tests for the merge machinery are spread over several places.
Collect them into t64xx for simplicity.  Some notes:

t60[234]*.sh:
  Merge tests started in t602*, overgrew bisect and remote tracking
  tests in t6030, t6040, and t6041, and nearly overtook replace tests
  in t6050.  This made picking out relevant tests that I wanted to run
  in a tighter loop slightly more annoying for years.

t303*.sh:
  These started out as tests for the 'merge-recursive' toplevel command,
  but did not restrict to that and had lots of overlap with the
  underlying merge machinery.
t7405, t7613:
  submodule-specific merge logic started out in submodule.c but was
  moved to merge-recursive.c in commit 18cfc08866 ("submodule.c: move
  submodule merging to merge-recursive.c", 2018-05-15).  Since these
  tests are about the logic found in the merge machinery, moving these
  tests to be with the merge tests makes sense.

t7607, t7609:
  Having tests spread all over the place makes it more likely that
  additional tests related to a certain piece of logic grow in all those
  other places.  Much like t303*.sh, these two tests were about the
  underlying merge machinery rather than outer levels.

Tests that were NOT moved:

t76[01]*.sh:
  Other than the four tests mentioned above, the remaining tests in
  t76[01]*.sh are related to non-recursive merge strategies, parameter
  parsing, and other stuff associated with the highlevel builtin/merge.c
  rather than the recursive merge machinery.

t3[45]*.sh:
  The rebase testcases in t34*.sh also test the merge logic pretty
  heavily; sometimes changes I make only trigger failures in the rebase
  tests.  The rebase tests are already nicely coupled together, though,
  and I didn't want to mess that up.  Similar comments apply for the
  cherry-pick tests in t35*.sh.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/{t6020-merge-df.sh => t6400-merge-df.sh}                        | 0
 t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh}      | 0
 t/{t6022-merge-rename.sh => t6402-merge-rename.sh}                | 0
 t/{t6023-merge-file.sh => t6403-merge-file.sh}                    | 0
 t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh}          | 0
 t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh}            | 0
 t/{t6026-merge-attr.sh => t6406-merge-attr.sh}                    | 0
 t/{t6027-merge-binary.sh => t6407-merge-binary.sh}                | 0
 t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh}        | 0
 t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh}              | 0
 t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh}            | 0
 t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh}    | 0
 t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh}                    | 0
 ...6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} | 0
 ...6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} | 0
 ...-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} | 0
 t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh}      | 0
 t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh}          | 0
 t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh}        | 0
 ...-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} | 0
 ...ge-rename-directories.sh => t6423-merge-rename-directories.sh} | 0
 ...ed-index-changes.sh => t6424-merge-unrelated-index-changes.sh} | 0
 t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh}  | 0
 ...p-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} | 0
 ...-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} | 0
 t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh}          | 0
 t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh}          | 0
 ...ve-space-options.sh => t6432-merge-recursive-space-options.sh} | 0
 t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh}            | 0
 ...-rename-options.sh => t6434-merge-recursive-rename-options.sh} | 0
 t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh}                | 0
 t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh}          | 0
 t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh}          | 0
 ...e-submodule.sh => t6438-submodule-directory-file-conflicts.sh} | 0
 t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh}  | 0
 35 files changed, 0 insertions(+), 0 deletions(-)
 rename t/{t6020-merge-df.sh => t6400-merge-df.sh} (100%)
 rename t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh} (100%)
 rename t/{t6022-merge-rename.sh => t6402-merge-rename.sh} (100%)
 rename t/{t6023-merge-file.sh => t6403-merge-file.sh} (100%)
 rename t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh} (100%)
 rename t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh} (100%)
 rename t/{t6026-merge-attr.sh => t6406-merge-attr.sh} (100%)
 rename t/{t6027-merge-binary.sh => t6407-merge-binary.sh} (100%)
 rename t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh} (100%)
 rename t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh} (100%)
 rename t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh} (100%)
 rename t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh} (100%)
 rename t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh} (100%)
 rename t/{t6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} (100%)
 rename t/{t6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} (100%)
 rename t/{t6036-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} (100%)
 rename t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh} (100%)
 rename t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh} (100%)
 rename t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh} (100%)
 rename t/{t6042-merge-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} (100%)
 rename t/{t6043-merge-rename-directories.sh => t6423-merge-rename-directories.sh} (100%)
 rename t/{t6044-merge-unrelated-index-changes.sh => t6424-merge-unrelated-index-changes.sh} (100%)
 rename t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh} (100%)
 rename t/{t6046-merge-skip-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} (100%)
 rename t/{t6047-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} (100%)
 rename t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh} (100%)
 rename t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh} (100%)
 rename t/{t3032-merge-recursive-space-options.sh => t6432-merge-recursive-space-options.sh} (100%)
 rename t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh} (100%)
 rename t/{t3034-merge-recursive-rename-options.sh => t6434-merge-recursive-rename-options.sh} (100%)
 rename t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh} (100%)
 rename t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh} (100%)
 rename t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh} (100%)
 rename t/{t7613-merge-submodule.sh => t6438-submodule-directory-file-conflicts.sh} (100%)
 rename t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh} (100%)

diff --git a/t/t6020-merge-df.sh b/t/t6400-merge-df.sh
similarity index 100%
rename from t/t6020-merge-df.sh
rename to t/t6400-merge-df.sh
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6401-merge-criss-cross.sh
similarity index 100%
rename from t/t6021-merge-criss-cross.sh
rename to t/t6401-merge-criss-cross.sh
diff --git a/t/t6022-merge-rename.sh b/t/t6402-merge-rename.sh
similarity index 100%
rename from t/t6022-merge-rename.sh
rename to t/t6402-merge-rename.sh
diff --git a/t/t6023-merge-file.sh b/t/t6403-merge-file.sh
similarity index 100%
rename from t/t6023-merge-file.sh
rename to t/t6403-merge-file.sh
diff --git a/t/t6024-recursive-merge.sh b/t/t6404-recursive-merge.sh
similarity index 100%
rename from t/t6024-recursive-merge.sh
rename to t/t6404-recursive-merge.sh
diff --git a/t/t6025-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
similarity index 100%
rename from t/t6025-merge-symlinks.sh
rename to t/t6405-merge-symlinks.sh
diff --git a/t/t6026-merge-attr.sh b/t/t6406-merge-attr.sh
similarity index 100%
rename from t/t6026-merge-attr.sh
rename to t/t6406-merge-attr.sh
diff --git a/t/t6027-merge-binary.sh b/t/t6407-merge-binary.sh
similarity index 100%
rename from t/t6027-merge-binary.sh
rename to t/t6407-merge-binary.sh
diff --git a/t/t6028-merge-up-to-date.sh b/t/t6408-merge-up-to-date.sh
similarity index 100%
rename from t/t6028-merge-up-to-date.sh
rename to t/t6408-merge-up-to-date.sh
diff --git a/t/t6029-merge-subtree.sh b/t/t6409-merge-subtree.sh
similarity index 100%
rename from t/t6029-merge-subtree.sh
rename to t/t6409-merge-subtree.sh
diff --git a/t/t6031-merge-filemode.sh b/t/t6411-merge-filemode.sh
similarity index 100%
rename from t/t6031-merge-filemode.sh
rename to t/t6411-merge-filemode.sh
diff --git a/t/t6032-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
similarity index 100%
rename from t/t6032-merge-large-rename.sh
rename to t/t6412-merge-large-rename.sh
diff --git a/t/t6033-merge-crlf.sh b/t/t6413-merge-crlf.sh
similarity index 100%
rename from t/t6033-merge-crlf.sh
rename to t/t6413-merge-crlf.sh
diff --git a/t/t6034-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
similarity index 100%
rename from t/t6034-merge-rename-nocruft.sh
rename to t/t6414-merge-rename-nocruft.sh
diff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
similarity index 100%
rename from t/t6035-merge-dir-to-symlink.sh
rename to t/t6415-merge-dir-to-symlink.sh
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
similarity index 100%
rename from t/t6036-recursive-corner-cases.sh
rename to t/t6416-recursive-corner-cases.sh
diff --git a/t/t6037-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
similarity index 100%
rename from t/t6037-merge-ours-theirs.sh
rename to t/t6417-merge-ours-theirs.sh
diff --git a/t/t6038-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
similarity index 100%
rename from t/t6038-merge-text-auto.sh
rename to t/t6418-merge-text-auto.sh
diff --git a/t/t6039-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
similarity index 100%
rename from t/t6039-merge-ignorecase.sh
rename to t/t6419-merge-ignorecase.sh
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
similarity index 100%
rename from t/t6042-merge-rename-corner-cases.sh
rename to t/t6422-merge-rename-corner-cases.sh
diff --git a/t/t6043-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
similarity index 100%
rename from t/t6043-merge-rename-directories.sh
rename to t/t6423-merge-rename-directories.sh
diff --git a/t/t6044-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh
similarity index 100%
rename from t/t6044-merge-unrelated-index-changes.sh
rename to t/t6424-merge-unrelated-index-changes.sh
diff --git a/t/t6045-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
similarity index 100%
rename from t/t6045-merge-rename-delete.sh
rename to t/t6425-merge-rename-delete.sh
diff --git a/t/t6046-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
similarity index 100%
rename from t/t6046-merge-skip-unneeded-updates.sh
rename to t/t6426-merge-skip-unneeded-updates.sh
diff --git a/t/t6047-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
similarity index 100%
rename from t/t6047-diff3-conflict-markers.sh
rename to t/t6427-diff3-conflict-markers.sh
diff --git a/t/t3030-merge-recursive.sh b/t/t6430-merge-recursive.sh
similarity index 100%
rename from t/t3030-merge-recursive.sh
rename to t/t6430-merge-recursive.sh
diff --git a/t/t3031-merge-criscross.sh b/t/t6431-merge-criscross.sh
similarity index 100%
rename from t/t3031-merge-criscross.sh
rename to t/t6431-merge-criscross.sh
diff --git a/t/t3032-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
similarity index 100%
rename from t/t3032-merge-recursive-space-options.sh
rename to t/t6432-merge-recursive-space-options.sh
diff --git a/t/t3033-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
similarity index 100%
rename from t/t3033-merge-toplevel.sh
rename to t/t6433-merge-toplevel.sh
diff --git a/t/t3034-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
similarity index 100%
rename from t/t3034-merge-recursive-rename-options.sh
rename to t/t6434-merge-recursive-rename-options.sh
diff --git a/t/t3035-merge-sparse.sh b/t/t6435-merge-sparse.sh
similarity index 100%
rename from t/t3035-merge-sparse.sh
rename to t/t6435-merge-sparse.sh
diff --git a/t/t7607-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
similarity index 100%
rename from t/t7607-merge-overwrite.sh
rename to t/t6436-merge-overwrite.sh
diff --git a/t/t7405-submodule-merge.sh b/t/t6437-submodule-merge.sh
similarity index 100%
rename from t/t7405-submodule-merge.sh
rename to t/t6437-submodule-merge.sh
diff --git a/t/t7613-merge-submodule.sh b/t/t6438-submodule-directory-file-conflicts.sh
similarity index 100%
rename from t/t7613-merge-submodule.sh
rename to t/t6438-submodule-directory-file-conflicts.sh
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
similarity index 100%
rename from t/t7609-merge-co-error-msgs.sh
rename to t/t6439-merge-co-error-msgs.sh
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v2 02/11] t6418: tighten delete/normalize conflict testcase
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
                     ` (9 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

The testcase only required that the merge complete without conflict,
without specifying what the correct resolution was.  Since normalization
changed this from a modify/delete to a not-modified/delete, the correct
resolution is to have the file be removed at the end.  Add a check for
this resolution.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6418-merge-text-auto.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 5e8d5fa50c..517f7a450d 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -211,7 +211,8 @@ test_expect_success 'Test delete/normalize conflict' '
 	git commit -m "remove file" &&
 	git checkout master &&
 	git reset --hard a^ &&
-	git merge side
+	git merge side &&
+	test_path_is_missing file
 '
 
 test_done
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 03/11] t6422: fix bad check against missing file
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-09  2:30     ` Eric Sunshine
  2020-08-08 17:01   ` [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
                     ` (8 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index f163893ff9..7da75c1736 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -906,7 +906,7 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git rev-parse >expect \
 			B:bar  A:bar  &&
 
-		test_cmp file_is_missing foo &&
+		test_path_is_missing foo &&
 		# bar should have two-way merged contents of the different
 		# versions of bar; check that content from both sides is
 		# present.
@@ -974,8 +974,8 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git rev-parse >expect \
 			O:foo  O:bar  &&
 
-		test_cmp file_is_missing foo &&
-		test_cmp file_is_missing bar &&
+		test_path_is_missing foo &&
+		test_path_is_missing bar &&
 		# baz should have two-way merged contents of the original
 		# contents of foo and bar; check that content from both sides
 		# is present.
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (2 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-09  3:12     ` Eric Sunshine
  2020-08-08 17:01   ` [PATCH v2 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
                     ` (7 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Apparently I don't know how to count untracked files, and since the tests
in question were marked as test_expect_failure, no one every noticed it
until know.  Correct the count, as these tests clearly creates three
untracked files ('out', 'err', and 'file_count').

(I believe this problem arose because earlier incarnations counted lines
via a pipe to 'wc -l'.  Reviewers asked that it be replaced by writing
the output to a file and using test_line_count, but when the temporary
output was added to a separate file, the count of untracked files should
have increased.)

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6416-recursive-corner-cases.sh    | 2 +-
 t/t6422-merge-rename-corner-cases.sh | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index b3bf462617..d272b418e4 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -1144,7 +1144,7 @@ test_expect_failure 'check symlink add/add' '
 		test_must_fail git merge -s recursive E^0 &&
 
 		git ls-files -s >out &&
-		test_line_count = 2 out &&
+		test_line_count = 3 out &&
 		git ls-files -u >out &&
 		test_line_count = 2 out &&
 		git ls-files -o >out &&
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 7da75c1736..c8ee033ad9 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -899,7 +899,7 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git ls-files -u >file_count &&
 		test_line_count = 2 file_count &&
 		git ls-files -o >file_count &&
-		test_line_count = 2 file_count &&
+		test_line_count = 3 file_count &&
 
 		git rev-parse >actual \
 			:2:bar :3:bar &&
@@ -967,7 +967,7 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git ls-files -u >file_count &&
 		test_line_count = 2 file_count &&
 		git ls-files -o >file_count &&
-		test_line_count = 2 file_count &&
+		test_line_count = 3 file_count &&
 
 		git rev-parse >actual \
 			:2:baz :3:baz &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 05/11] t6423: fix test setup for a couple tests
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (3 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Commit da1e295e00 ("t604[236]: do not run setup in separate tests",
2019-10-22) removed approximately half the tests (which were setup-only
tests) in t6043 by turning them into functions that the subsequent test
would call as their first step.  This ensured that any test from this
file could be run entirely independently of all the other tests in the
file.  Unfortunately, the call to the new setup function was missed in
two of the test_expect_failure cases.  Add them in.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6423-merge-rename-directories.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 83792c5ef1..d227e15944 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2880,6 +2880,7 @@ test_setup_9g () {
 }
 
 test_expect_failure '9g: Renamed directory that only contained immediate subdirs, immediate subdirs renamed' '
+	test_setup_9g &&
 	(
 		cd 9g &&
 
@@ -3362,6 +3363,7 @@ test_setup_10e () {
 }
 
 test_expect_failure '10e: Does git complain about untracked file that is not really in the way?' '
+	test_setup_10e &&
 	(
 		cd 10e &&
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 06/11] t6422: fix multiple errors with the mod6 test expectations
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (4 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

This test had multiple issues causing it to fail for the wrong
reason(s):

  * rename/rename(1to2) conflicts have always left the original source
    path present in the working directory and index (at stage 1).  Thus,
    the triple rename/rename(1to2) should result in 9 unstaged files,
    not 6.
  * It messed up the three-way content merge for checking the results of
    merging for one of the renames, accidentally turning it into a
    two-way merge.
  * It got the contents of the base files it was using to compare
    against wrong, due to an off-by-one error, and overwrite-redirection
    ('>') instead of append-redirection ('>>').
  * It used slightly too-long conflict markers
  * It didn't include filenames in the conflict marker hunks (granted,
    that was a shortcoming of the merge-recursive backend for rename/add
    and rename/rename(2to1) conflicts, but since it's
    test_expect_failure anyway we might as well make it expect our
    preferred behavior rather than some compromise that we can't yet
    reach anyway).

Fix these issues so that a merge backend which correctly handles these
kinds of nested conflicts will pass the test.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index c8ee033ad9..2413f517e7 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1042,25 +1042,25 @@ test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename
 		test_must_be_empty err &&
 
 		git ls-files -s >file_count &&
-		test_line_count = 6 file_count &&
+		test_line_count = 9 file_count &&
 		git ls-files -u >file_count &&
-		test_line_count = 6 file_count &&
+		test_line_count = 9 file_count &&
 		git ls-files -o >file_count &&
 		test_line_count = 3 file_count &&
 
 		test_seq 10 20 >merged-one &&
 		test_seq 51 60 >merged-five &&
 		# Determine what the merge of three would give us.
-		test_seq 30 40 >three-side-A &&
+		test_seq 31 39 >three-base &&
+		test_seq 31 40 >three-side-A &&
 		test_seq 31 39 >three-side-B &&
-		echo forty >three-side-B &&
-		>empty &&
+		echo forty >>three-side-B &&
 		test_must_fail git merge-file \
-			-L "HEAD" \
+			-L "HEAD:four" \
 			-L "" \
-			-L "B^0" \
-			three-side-A empty three-side-B &&
-		sed -e "s/^\([<=>]\)/\1\1\1/" three-side-A >merged-three &&
+			-L "B^0:two" \
+			three-side-A three-base three-side-B &&
+		sed -e "s/^\([<=>]\)/\1\1/" three-side-A >merged-three &&
 
 		# Verify the index is as expected
 		git rev-parse >actual         \
@@ -1075,6 +1075,7 @@ test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename
 
 		git cat-file -p :2:two >expect &&
 		git cat-file -p :3:two >other &&
+		>empty &&
 		test_must_fail git merge-file    \
 			-L "HEAD"  -L ""  -L "B^0" \
 			expect     empty  other &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 07/11] t6416, t6423: clarify some comments and fix some typos
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (5 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6416-recursive-corner-cases.sh   |  2 +-
 t/t6423-merge-rename-directories.sh | 25 ++++++++++++-------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index d272b418e4..fd98989b14 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -452,7 +452,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 #
 # So choice 5 at least provides some kind of conflict for the original case,
 # and can merge cleanly as expected with D1 and E3.  It also made things just
-# slightly funny for merging D1 and e$, where E4 is defined as:
+# slightly funny for merging D1 and E4, where E4 is defined as:
 #   Commit E4: Merge B & C, modifying 'a' and renaming to 'a2', and deleting 'a/'
 # in this case, we'll get a rename/rename(1to2) conflict because a~$UNIQUE
 # gets renamed to 'a' in D1 and to 'a2' in E4.  But that's better than having
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index d227e15944..bd0f17a3be 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2260,24 +2260,23 @@ test_expect_success '8d: rename/delete...or not?' '
 #   Commit B: w/{b,c}, z/d
 #
 # Possible Resolutions:
-#   w/o dir-rename detection: z/d, CONFLICT(z/b -> y/b vs. w/b),
-#                                  CONFLICT(z/c -> y/c vs. w/c)
-#   Currently expected:       y/d, CONFLICT(z/b -> y/b vs. w/b),
-#                                  CONFLICT(z/c -> y/c vs. w/c)
-#   Optimal:                  ??
+#   if z not considered renamed: z/d, CONFLICT(z/b -> y/b vs. w/b),
+#                                     CONFLICT(z/c -> y/c vs. w/c)
+#   if z->y rename considered:   y/d, CONFLICT(z/b -> y/b vs. w/b),
+#                                     CONFLICT(z/c -> y/c vs. w/c)
+#   Optimal:                     ??
 #
 # Notes: In commit A, directory z got renamed to y.  In commit B, directory z
 #        did NOT get renamed; the directory is still present; instead it is
 #        considered to have just renamed a subset of paths in directory z
-#        elsewhere.  Therefore, the directory rename done in commit A to z/
-#        applies to z/d and maps it to y/d.
+#        elsewhere.  However, this is much like testcase 6b (where commit B
+#        moves all the original paths out of z/ but opted to keep d
+#        within z/).  This makes it hard to judge where d should end up.
 #
 #        It's possible that users would get confused about this, but what
-#        should we do instead?  Silently leaving at z/d seems just as bad or
-#        maybe even worse.  Perhaps we could print a big warning about z/d
-#        and how we're moving to y/d in this case, but when I started thinking
-#        about the ramifications of doing that, I didn't know how to rule out
-#        that opening other weird edge and corner cases so I just punted.
+#        should we do instead?  It's not at all clear to me whether z/d or
+#        y/d or something else is a better resolution here, and other cases
+#        start getting really tricky, so I just picked one.
 
 test_setup_8e () {
 	test_create_repo 8e &&
@@ -4405,7 +4404,7 @@ test_expect_success '13b(info): messages for transitive rename with conflicted c
 #   Commit O: z/{b,c},   x/{d,e}
 #   Commit A: y/{b,c,d}, x/e
 #   Commit B: z/{b,c,d}, x/e
-#   Expected: y/{b,c,d}, with info or conflict messages for d (
+#   Expected: y/{b,c,d}, x/e, with info or conflict messages for d
 #             A: renamed x/d -> z/d; B: renamed z/ -> y/ AND renamed x/d to y/d
 #             One could argue A had partial knowledge of what was done with
 #             d and B had full knowledge, but that's a slippery slope as
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 08/11] t6423: add an explanation about why one of the tests does not pass
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (6 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

While we're at it, document why one of the two tests doesn't pass (since
I had long since forgotten it)...though the reasoning makes me question
why it's considered a failure at all.  Maybe I had a good reason when I
introduced it, or maybe I just wasn't looking at it clearly?  Either
way, the explanation may help a future reader.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6423-merge-rename-directories.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index bd0f17a3be..2b4a482277 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2843,6 +2843,14 @@ test_expect_success '9f: Renamed directory that only contained immediate subdirs
 #   Commit A: priority/{alpha,bravo}/$more_files
 #   Commit B: goal/{a,b}/$more_files, goal/c
 #   Expected: priority/{alpha,bravo}/$more_files, priority/c
+# We currently fail this test because the directory renames we detect are
+#   goal/a/ -> priority/alpha/
+#   goal/b/ -> priority/bravo/
+# We do not detect
+#   goal/   -> priority/
+# because of no files found within goal/, and the fact that "a" != "alpha"
+# and "b" != "bravo".  But I'm not sure it's really a failure given that
+# viewpoint...
 
 test_setup_9g () {
 	test_create_repo 9g &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (7 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

merge-recursive treats an add/add conflict where one of the adds came
from a rename as a separate 'rename/add' type of conflict.  However, if
there is not content conflict after the content merge(s), then the file
is not considered to be conflicted.  That suggests the conflict type is
really just add/add.  Other merge engines might choose to print messages
to the console that just refer to these as add/add conflicts; accept
both types of output.

Note: it could help to notify users if the three-way content merge of
the rename had content conflicts, because when we then go to two-way
merge THAT with the conflicting add we can get nested conflict markers.
merge-recursive, unfortunately, doesn't do that, but other merge engines
could.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh   | 21 +++++++++++++--------
 t/t6426-merge-skip-unneeded-updates.sh |  2 +-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 2413f517e7..f3929b65c0 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -457,7 +457,7 @@ test_expect_success 'handle rename-with-content-merge vs. add' '
 		git checkout A^0 &&
 
 		test_must_fail git merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -503,7 +503,7 @@ test_expect_success 'handle rename-with-content-merge vs. add, merge other way'
 		git checkout B^0 &&
 
 		test_must_fail git merge -s recursive A^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -886,12 +886,17 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git checkout B^0 &&
 		test_must_fail git merge -s recursive A^0 >out 2>err &&
 
-		# Not sure whether the output should contain just one
-		# "CONFLICT (rename/add/delete)" line, or if it should break
-		# it into a pair of "CONFLICT (rename/delete)" and
-		# "CONFLICT (rename/add)"; allow for either.
-		test_i18ngrep "CONFLICT (rename.*add)" out &&
-		test_i18ngrep "CONFLICT (rename.*delete)" out &&
+		# Instead of requiring the output to contain one combined line
+		#   CONFLICT (rename/add/delete)
+		# or perhaps two lines:
+		#   CONFLICT (rename/add): new file collides with rename target
+		#   CONFLICT (rename/delete): rename source removed on other side
+		# and instead of requiring "rename/add" instead of "add/add",
+		# be flexible in the type of console output message(s) reported
+		# for this particular case; we will be more stringent about the
+		# contents of the index and working directory.
+		test_i18ngrep "CONFLICT (.*/add)" out &&
+		test_i18ngrep "CONFLICT (rename.*/delete)" out &&
 		test_must_be_empty err &&
 
 		git ls-files -s >file_count &&
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 5a2d07e516..699813671c 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -374,7 +374,7 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
 		export GIT_MERGE_VERBOSITY &&
 		test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-		test_i18ngrep "CONFLICT (rename/add): Rename b->c" out &&
+		test_i18ngrep "CONFLICT (.*/add):" out &&
 		test_must_be_empty err &&
 
 		# Make sure c WAS updated
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (8 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-08 17:01   ` [PATCH v2 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Much like the last commit accepted 'add/add' and 'rename/add'
interchangably, we also want to do the same for 'add/add' and
'rename/rename'.  This also allows us to avoid the ambiguity in meaning
with 'rename/rename' (is it two separate files renamed to the same
location, or one file renamed on both sides but differently)?

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 18 ++++++++++++------
 t/t6423-merge-rename-directories.sh  |  4 ++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index f3929b65c0..3375eaf4e7 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -583,7 +583,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
 		git checkout B^0 &&
 
 		test_must_fail git merge -s recursive C^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -959,11 +959,17 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git checkout A^0 &&
 		test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-		# Not sure whether the output should contain just one
-		# "CONFLICT (rename/rename/delete/delete)" line, or if it
-		# should break it into three: "CONFLICT (rename/rename)" and
-		# two "CONFLICT (rename/delete)" lines; allow for either.
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		# Instead of requiring the output to contain one combined line
+		#   CONFLICT (rename/rename/delete/delete)
+		# or perhaps two lines:
+		#   CONFLICT (rename/rename): ...
+		#   CONFLICT (rename/delete): info about pair 1
+		#   CONFLICT (rename/delete): info about pair 2
+		# and instead of requiring "rename/rename" instead of "add/add",
+		# be flexible in the type of console output message(s) reported
+		# for this particular case; we will be more stringent about the
+		# contents of the index and working directory.
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 		test_i18ngrep "CONFLICT (rename.*delete)" out &&
 		test_must_be_empty err &&
 
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 2b4a482277..f7ecbb886d 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -275,7 +275,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
 		git checkout A^0 &&
 
 		test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 8 out &&
@@ -1686,7 +1686,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
 		git checkout A^0 &&
 
 		test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 4 out &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v2 11/11] t6425: be more flexible with rename/delete conflict messages
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (9 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
@ 2020-08-08 17:01   ` Elijah Newren via GitGitGadget
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  11 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-08 17:01 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

t6425 was very picky about the exact output message produced by a
rename/delete conflict, in a way that just scratches the surface of the
mess that was built into merge-recursive.  The idea was that it would
try to find the possible combinations of different conflict types, and
when more than one was present for one path, it would try to provide a
combined message that covered all the cases.

There's a lot to unravel here...

First, there's a basic conflict type known as modify/delete, which is a
content conflict.  It occurs when one side deletes a file, but the other
modifies it.

There is also a path conflict known as a rename/delete.  This occurs
when one side deletes a path, and the other renames it.  This is not a
content conflict, it is a path conflict.  It will often occur in
combination with a content conflict, though, namely a modify/delete.  As
such, these two were often combined.

Another type of conflict that can exist is a directory/file conflict.
For example, one side adds a new file at some path, and the other side
of history adds a directory at the same path.  The path that was "added"
could have been put there by a rename, though.  Thus, we have the
possibility of a single path being affected by a modify/delete, a
rename/delete, and a directory/file conflict.

In part, this was a natural by-product of merge-recursive's design.
Since it was doing a four way merge with the contents of the working
tree being the fourth factor it had to consider, it had working tree
handling spread all over the code.  It also had directory/file conflict
handling spread everywhere through all the other types of conflicts.
And our testsuite has a huge number of directory/file conflict tests
because trying to get them right required modifying so many different
codepaths.  A natural outgrowth of this kind of structure is conflict
messages that combine all the different types that the current codepath
is considering.

However, if we want to make the different conflict types orthogonal and
avoid repeating ourselves and getting very brittle code, then we need to
split the messages from these different conflict types apart.  Besides,
trying to determine all possible permutations is a _royal_ mess.  The
code to handle the rename/delete/directory/file conflict output is
already somewhat hard to parse, and is somewhat brittle.  But if we
really wanted to go that route, then we'd have to have special handling
for the following types of combinations:
  * rename/add/delete:
      on side of history that didn't rename the given file, remove the file
      instead and place an unrelated file in the way of the rename
  * rename/rename(2to1)/mode conflict/delete/delete:
      two different files, one executable and the other not, are renamed
      to the same location, each side deletes the source file that the
      other side renames
  * rename/rename(1to2)/add/add:
      file renamed differently on each side of history, with each side
      placing an unrelated file in the way of the other
  * rename/rename(1to2)/content conflict/file location/(D/F)/(D/F)/:
      both sides modify a file in conflicting way, both rename that file
      but to different paths, one side renames the directory which the
      other side had renamed that file into causing it to possibly need a
      transitive rename, and each side puts a directory in the way of the
      other's path.

Let's back away from this path of insanity, and allow the different
types of conflicts to be handled by separate pieces of non-repeated code
by allowing the conflict messages to be split into their separate types.
(If multiple conflict types affect a single path, the conflict messages
can be printed sequentially.)  Start this path with a simple change:
modify this test to be more flexible and accept the output either merge
backend (recursive or the new ort) will produce.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6425-merge-rename-delete.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index 5d33577d2f..f79d021590 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -17,7 +17,8 @@ test_expect_success 'rename/delete' '
 	git commit -m "delete" &&
 
 	test_must_fail git merge --strategy=recursive rename >output &&
-	test_i18ngrep "CONFLICT (rename/delete): A deleted in HEAD and renamed to B in rename. Version rename of B left in tree." output
+	test_i18ngrep "CONFLICT (rename/delete): A.* renamed .*to B.* in rename" output &&
+	test_i18ngrep "CONFLICT (rename/delete): A.*deleted in HEAD." output
 '
 
 test_done
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 03/11] t6422: fix bad check against missing file
  2020-08-08 17:01   ` [PATCH v2 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
@ 2020-08-09  2:30     ` Eric Sunshine
  0 siblings, 0 replies; 28+ messages in thread
From: Eric Sunshine @ 2020-08-09  2:30 UTC (permalink / raw)
  To: Elijah Newren via GitGitGadget; +Cc: Git List, Elijah Newren

On Sat, Aug 8, 2020 at 1:02 PM Elijah Newren via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
> diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
> @@ -974,8 +974,8 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
> -               test_cmp file_is_missing foo &&
> -               test_cmp file_is_missing bar &&
> +               test_path_is_missing foo &&
> +               test_path_is_missing bar &&

These errors in the tests went unnoticed because they are inside
test_expect_failure(), which makes one wonder if test_cmp() should be
updated to throw a hard error to help diagnose this sort of problem
sooner. (Then again, that might be overkill since there are relatively
few test_expect_failures() around, so it may not buy us much. On the
other hand, every little bit helps.)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count
  2020-08-08 17:01   ` [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
@ 2020-08-09  3:12     ` Eric Sunshine
  2020-08-09  5:34       ` Elijah Newren
  0 siblings, 1 reply; 28+ messages in thread
From: Eric Sunshine @ 2020-08-09  3:12 UTC (permalink / raw)
  To: Elijah Newren via GitGitGadget; +Cc: Git List, Elijah Newren

On Sat, Aug 8, 2020 at 1:01 PM Elijah Newren via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> Apparently I don't know how to count untracked files, and since the tests
> in question were marked as test_expect_failure, no one every noticed it
> until know.  Correct the count, as these tests clearly creates three
> untracked files ('out', 'err', and 'file_count').

s/every/ever/
s/know/now/
s/creates/create/

> (I believe this problem arose because earlier incarnations counted lines
> via a pipe to 'wc -l'.  Reviewers asked that it be replaced by writing
> the output to a file and using test_line_count, but when the temporary
> output was added to a separate file, the count of untracked files should
> have increased.)
>
> Signed-off-by: Elijah Newren <newren@gmail.com>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count
  2020-08-09  3:12     ` Eric Sunshine
@ 2020-08-09  5:34       ` Elijah Newren
  0 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren @ 2020-08-09  5:34 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Elijah Newren via GitGitGadget, Git List

On Sat, Aug 8, 2020 at 8:12 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
>
> On Sat, Aug 8, 2020 at 1:01 PM Elijah Newren via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> > Apparently I don't know how to count untracked files, and since the tests
> > in question were marked as test_expect_failure, no one every noticed it
> > until know.  Correct the count, as these tests clearly creates three
> > untracked files ('out', 'err', and 'file_count').
>
> s/every/ever/
> s/know/now/
> s/creates/create/

Wow, that's a pretty high typo density; how embarrassing.  Thanks for
pointing out the fixes; I'll include them in the next reroll.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends
  2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                     ` (10 preceding siblings ...)
  2020-08-08 17:01   ` [PATCH v2 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
@ 2020-08-10 22:29   ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
                       ` (10 more replies)
  11 siblings, 11 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren

This series starts preparing the merge related tests to work with multiple
backends: merge-recursive or merge-ort. Further work will be coming.

Changes since v2:

 * fix typos pointed out by Eric
 * reworded another commit message for clarify

The greater flexibility patches at the end of the series also previews some
of the design changes being brought by merge-ort.

Merges cleanly with next and seen, despite the pile of testcase renames.

Elijah Newren (11):
  Collect merge-related tests to t64xx
  t6418: tighten delete/normalize conflict testcase
  t6422: fix bad check against missing file
  t6416, t6422: fix incorrect untracked file count
  t6423: fix test setup for a couple tests
  t6422: fix multiple errors with the mod6 test expectations
  t6416, t6423: clarify some comments and fix some typos
  t6423: add an explanation about why one of the tests does not pass
  t6422, t6426: be more flexible for add/add conflicts involving renames
  t642[23]: be more flexible for add/add conflicts involving pair
    renames
  t6425: be more flexible with rename/delete conflict messages

 t/{t6020-merge-df.sh => t6400-merge-df.sh}    |  0
 ...ss-cross.sh => t6401-merge-criss-cross.sh} |  0
 ...-merge-rename.sh => t6402-merge-rename.sh} |  0
 ...6023-merge-file.sh => t6403-merge-file.sh} |  0
 ...sive-merge.sh => t6404-recursive-merge.sh} |  0
 ...ge-symlinks.sh => t6405-merge-symlinks.sh} |  0
 ...6026-merge-attr.sh => t6406-merge-attr.sh} |  0
 ...-merge-binary.sh => t6407-merge-binary.sh} |  0
 ...p-to-date.sh => t6408-merge-up-to-date.sh} |  0
 ...erge-subtree.sh => t6409-merge-subtree.sh} |  0
 ...ge-filemode.sh => t6411-merge-filemode.sh} |  0
 ...-rename.sh => t6412-merge-large-rename.sh} |  0
 ...6033-merge-crlf.sh => t6413-merge-crlf.sh} |  0
 ...cruft.sh => t6414-merge-rename-nocruft.sh} |  0
 ...mlink.sh => t6415-merge-dir-to-symlink.sh} |  0
 ...ses.sh => t6416-recursive-corner-cases.sh} |  4 +-
 ...s-theirs.sh => t6417-merge-ours-theirs.sh} |  0
 ...-text-auto.sh => t6418-merge-text-auto.sh} |  3 +-
 ...gnorecase.sh => t6419-merge-ignorecase.sh} |  0
 ....sh => t6422-merge-rename-corner-cases.sh} | 68 +++++++++++--------
 ...s.sh => t6423-merge-rename-directories.sh} | 39 +++++++----
 ...=> t6424-merge-unrelated-index-changes.sh} |  0
 ...delete.sh => t6425-merge-rename-delete.sh} |  3 +-
 ...h => t6426-merge-skip-unneeded-updates.sh} |  2 +-
 ...ers.sh => t6427-diff3-conflict-markers.sh} |  0
 ...-recursive.sh => t6430-merge-recursive.sh} |  0
 ...-criscross.sh => t6431-merge-criscross.sh} |  0
 ...=> t6432-merge-recursive-space-options.sh} |  0
 ...ge-toplevel.sh => t6433-merge-toplevel.sh} |  0
 ...> t6434-merge-recursive-rename-options.sh} |  0
 ...-merge-sparse.sh => t6435-merge-sparse.sh} |  0
 ...-overwrite.sh => t6436-merge-overwrite.sh} |  0
 ...dule-merge.sh => t6437-submodule-merge.sh} |  0
 ...438-submodule-directory-file-conflicts.sh} |  0
 ...r-msgs.sh => t6439-merge-co-error-msgs.sh} |  0
 35 files changed, 71 insertions(+), 48 deletions(-)
 rename t/{t6020-merge-df.sh => t6400-merge-df.sh} (100%)
 rename t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh} (100%)
 rename t/{t6022-merge-rename.sh => t6402-merge-rename.sh} (100%)
 rename t/{t6023-merge-file.sh => t6403-merge-file.sh} (100%)
 rename t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh} (100%)
 rename t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh} (100%)
 rename t/{t6026-merge-attr.sh => t6406-merge-attr.sh} (100%)
 rename t/{t6027-merge-binary.sh => t6407-merge-binary.sh} (100%)
 rename t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh} (100%)
 rename t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh} (100%)
 rename t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh} (100%)
 rename t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh} (100%)
 rename t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh} (100%)
 rename t/{t6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} (100%)
 rename t/{t6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} (100%)
 rename t/{t6036-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} (99%)
 rename t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh} (100%)
 rename t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh} (99%)
 rename t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh} (100%)
 rename t/{t6042-merge-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} (94%)
 rename t/{t6043-merge-rename-directories.sh => t6423-merge-rename-directories.sh} (98%)
 rename t/{t6044-merge-unrelated-index-changes.sh => t6424-merge-unrelated-index-changes.sh} (100%)
 rename t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh} (72%)
 rename t/{t6046-merge-skip-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} (99%)
 rename t/{t6047-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} (100%)
 rename t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh} (100%)
 rename t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh} (100%)
 rename t/{t3032-merge-recursive-space-options.sh => t6432-merge-recursive-space-options.sh} (100%)
 rename t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh} (100%)
 rename t/{t3034-merge-recursive-rename-options.sh => t6434-merge-recursive-rename-options.sh} (100%)
 rename t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh} (100%)
 rename t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh} (100%)
 rename t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh} (100%)
 rename t/{t7613-merge-submodule.sh => t6438-submodule-directory-file-conflicts.sh} (100%)
 rename t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh} (100%)


base-commit: 4f0a8be78499454eac3985b6e7e144b8376ab0a5
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-827%2Fnewren%2Fmerge-test-rename-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-827/newren/merge-test-rename-v3
Pull-Request: https://github.com/git/git/pull/827

Range-diff vs v2:

  1:  3a2b7e9743 =  1:  8fec657942 Collect merge-related tests to t64xx
  2:  621c9a159e =  2:  b35b61007e t6418: tighten delete/normalize conflict testcase
  3:  7f408b7d40 =  3:  d35d4b1922 t6422: fix bad check against missing file
  4:  9ce80f2f94 !  4:  78df85aee5 t6416, t6422: fix incorrect untracked file count
     @@ Metadata
       ## Commit message ##
          t6416, t6422: fix incorrect untracked file count
      
     -    Apparently I don't know how to count untracked files, and since the tests
     -    in question were marked as test_expect_failure, no one every noticed it
     -    until know.  Correct the count, as these tests clearly creates three
     -    untracked files ('out', 'err', and 'file_count').
     +    Apparently I don't know how to count untracked files, and since the
     +    tests in question were marked as test_expect_failure, no one ever
     +    noticed it until now.  Correct the count, as these tests clearly create
     +    three untracked files ('out', 'err', and 'file_count').
      
          (I believe this problem arose because earlier incarnations counted lines
          via a pipe to 'wc -l'.  Reviewers asked that it be replaced by writing
  5:  382d65649d =  5:  8ac78dc71b t6423: fix test setup for a couple tests
  6:  56e169b1d8 =  6:  6674ae9de4 t6422: fix multiple errors with the mod6 test expectations
  7:  7b534d123a =  7:  783ebb6576 t6416, t6423: clarify some comments and fix some typos
  8:  f2d7e744fc !  8:  82e1b0e696 t6423: add an explanation about why one of the tests does not pass
     @@ Metadata
       ## Commit message ##
          t6423: add an explanation about why one of the tests does not pass
      
     -    While we're at it, document why one of the two tests doesn't pass (since
     -    I had long since forgotten it)...though the reasoning makes me question
     -    why it's considered a failure at all.  Maybe I had a good reason when I
     -    introduced it, or maybe I just wasn't looking at it clearly?  Either
     -    way, the explanation may help a future reader.
     +    I had long since forgotten the idea behind this test and why it failed,
     +    and took a little while to figure it out.  To prevent others from having
     +    to spend a similar time on it, add an explanation in the comments.
     +    However, the reasoning in the explanation makes me question why I
     +    considered it a failure at all.  I'm not sure if I had a better reason
     +    when I originally wrote it, but for now just add commentary about the
     +    possible expectations and why it behaves the way it does right now.
      
          Signed-off-by: Elijah Newren <newren@gmail.com>
      
  9:  b4e165eca4 =  9:  42e3f699f1 t6422, t6426: be more flexible for add/add conflicts involving renames
 10:  a9a02a0ca5 = 10:  456160f3a7 t642[23]: be more flexible for add/add conflicts involving pair renames
 11:  38f6573511 = 11:  0c8dcbf01c t6425: be more flexible with rename/delete conflict messages

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v3 01/11] Collect merge-related tests to t64xx
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
                       ` (9 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

The tests for the merge machinery are spread over several places.
Collect them into t64xx for simplicity.  Some notes:

t60[234]*.sh:
  Merge tests started in t602*, overgrew bisect and remote tracking
  tests in t6030, t6040, and t6041, and nearly overtook replace tests
  in t6050.  This made picking out relevant tests that I wanted to run
  in a tighter loop slightly more annoying for years.

t303*.sh:
  These started out as tests for the 'merge-recursive' toplevel command,
  but did not restrict to that and had lots of overlap with the
  underlying merge machinery.
t7405, t7613:
  submodule-specific merge logic started out in submodule.c but was
  moved to merge-recursive.c in commit 18cfc08866 ("submodule.c: move
  submodule merging to merge-recursive.c", 2018-05-15).  Since these
  tests are about the logic found in the merge machinery, moving these
  tests to be with the merge tests makes sense.

t7607, t7609:
  Having tests spread all over the place makes it more likely that
  additional tests related to a certain piece of logic grow in all those
  other places.  Much like t303*.sh, these two tests were about the
  underlying merge machinery rather than outer levels.

Tests that were NOT moved:

t76[01]*.sh:
  Other than the four tests mentioned above, the remaining tests in
  t76[01]*.sh are related to non-recursive merge strategies, parameter
  parsing, and other stuff associated with the highlevel builtin/merge.c
  rather than the recursive merge machinery.

t3[45]*.sh:
  The rebase testcases in t34*.sh also test the merge logic pretty
  heavily; sometimes changes I make only trigger failures in the rebase
  tests.  The rebase tests are already nicely coupled together, though,
  and I didn't want to mess that up.  Similar comments apply for the
  cherry-pick tests in t35*.sh.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/{t6020-merge-df.sh => t6400-merge-df.sh}                        | 0
 t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh}      | 0
 t/{t6022-merge-rename.sh => t6402-merge-rename.sh}                | 0
 t/{t6023-merge-file.sh => t6403-merge-file.sh}                    | 0
 t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh}          | 0
 t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh}            | 0
 t/{t6026-merge-attr.sh => t6406-merge-attr.sh}                    | 0
 t/{t6027-merge-binary.sh => t6407-merge-binary.sh}                | 0
 t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh}        | 0
 t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh}              | 0
 t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh}            | 0
 t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh}    | 0
 t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh}                    | 0
 ...6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} | 0
 ...6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} | 0
 ...-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} | 0
 t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh}      | 0
 t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh}          | 0
 t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh}        | 0
 ...-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} | 0
 ...ge-rename-directories.sh => t6423-merge-rename-directories.sh} | 0
 ...ed-index-changes.sh => t6424-merge-unrelated-index-changes.sh} | 0
 t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh}  | 0
 ...p-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} | 0
 ...-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} | 0
 t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh}          | 0
 t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh}          | 0
 ...ve-space-options.sh => t6432-merge-recursive-space-options.sh} | 0
 t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh}            | 0
 ...-rename-options.sh => t6434-merge-recursive-rename-options.sh} | 0
 t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh}                | 0
 t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh}          | 0
 t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh}          | 0
 ...e-submodule.sh => t6438-submodule-directory-file-conflicts.sh} | 0
 t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh}  | 0
 35 files changed, 0 insertions(+), 0 deletions(-)
 rename t/{t6020-merge-df.sh => t6400-merge-df.sh} (100%)
 rename t/{t6021-merge-criss-cross.sh => t6401-merge-criss-cross.sh} (100%)
 rename t/{t6022-merge-rename.sh => t6402-merge-rename.sh} (100%)
 rename t/{t6023-merge-file.sh => t6403-merge-file.sh} (100%)
 rename t/{t6024-recursive-merge.sh => t6404-recursive-merge.sh} (100%)
 rename t/{t6025-merge-symlinks.sh => t6405-merge-symlinks.sh} (100%)
 rename t/{t6026-merge-attr.sh => t6406-merge-attr.sh} (100%)
 rename t/{t6027-merge-binary.sh => t6407-merge-binary.sh} (100%)
 rename t/{t6028-merge-up-to-date.sh => t6408-merge-up-to-date.sh} (100%)
 rename t/{t6029-merge-subtree.sh => t6409-merge-subtree.sh} (100%)
 rename t/{t6031-merge-filemode.sh => t6411-merge-filemode.sh} (100%)
 rename t/{t6032-merge-large-rename.sh => t6412-merge-large-rename.sh} (100%)
 rename t/{t6033-merge-crlf.sh => t6413-merge-crlf.sh} (100%)
 rename t/{t6034-merge-rename-nocruft.sh => t6414-merge-rename-nocruft.sh} (100%)
 rename t/{t6035-merge-dir-to-symlink.sh => t6415-merge-dir-to-symlink.sh} (100%)
 rename t/{t6036-recursive-corner-cases.sh => t6416-recursive-corner-cases.sh} (100%)
 rename t/{t6037-merge-ours-theirs.sh => t6417-merge-ours-theirs.sh} (100%)
 rename t/{t6038-merge-text-auto.sh => t6418-merge-text-auto.sh} (100%)
 rename t/{t6039-merge-ignorecase.sh => t6419-merge-ignorecase.sh} (100%)
 rename t/{t6042-merge-rename-corner-cases.sh => t6422-merge-rename-corner-cases.sh} (100%)
 rename t/{t6043-merge-rename-directories.sh => t6423-merge-rename-directories.sh} (100%)
 rename t/{t6044-merge-unrelated-index-changes.sh => t6424-merge-unrelated-index-changes.sh} (100%)
 rename t/{t6045-merge-rename-delete.sh => t6425-merge-rename-delete.sh} (100%)
 rename t/{t6046-merge-skip-unneeded-updates.sh => t6426-merge-skip-unneeded-updates.sh} (100%)
 rename t/{t6047-diff3-conflict-markers.sh => t6427-diff3-conflict-markers.sh} (100%)
 rename t/{t3030-merge-recursive.sh => t6430-merge-recursive.sh} (100%)
 rename t/{t3031-merge-criscross.sh => t6431-merge-criscross.sh} (100%)
 rename t/{t3032-merge-recursive-space-options.sh => t6432-merge-recursive-space-options.sh} (100%)
 rename t/{t3033-merge-toplevel.sh => t6433-merge-toplevel.sh} (100%)
 rename t/{t3034-merge-recursive-rename-options.sh => t6434-merge-recursive-rename-options.sh} (100%)
 rename t/{t3035-merge-sparse.sh => t6435-merge-sparse.sh} (100%)
 rename t/{t7607-merge-overwrite.sh => t6436-merge-overwrite.sh} (100%)
 rename t/{t7405-submodule-merge.sh => t6437-submodule-merge.sh} (100%)
 rename t/{t7613-merge-submodule.sh => t6438-submodule-directory-file-conflicts.sh} (100%)
 rename t/{t7609-merge-co-error-msgs.sh => t6439-merge-co-error-msgs.sh} (100%)

diff --git a/t/t6020-merge-df.sh b/t/t6400-merge-df.sh
similarity index 100%
rename from t/t6020-merge-df.sh
rename to t/t6400-merge-df.sh
diff --git a/t/t6021-merge-criss-cross.sh b/t/t6401-merge-criss-cross.sh
similarity index 100%
rename from t/t6021-merge-criss-cross.sh
rename to t/t6401-merge-criss-cross.sh
diff --git a/t/t6022-merge-rename.sh b/t/t6402-merge-rename.sh
similarity index 100%
rename from t/t6022-merge-rename.sh
rename to t/t6402-merge-rename.sh
diff --git a/t/t6023-merge-file.sh b/t/t6403-merge-file.sh
similarity index 100%
rename from t/t6023-merge-file.sh
rename to t/t6403-merge-file.sh
diff --git a/t/t6024-recursive-merge.sh b/t/t6404-recursive-merge.sh
similarity index 100%
rename from t/t6024-recursive-merge.sh
rename to t/t6404-recursive-merge.sh
diff --git a/t/t6025-merge-symlinks.sh b/t/t6405-merge-symlinks.sh
similarity index 100%
rename from t/t6025-merge-symlinks.sh
rename to t/t6405-merge-symlinks.sh
diff --git a/t/t6026-merge-attr.sh b/t/t6406-merge-attr.sh
similarity index 100%
rename from t/t6026-merge-attr.sh
rename to t/t6406-merge-attr.sh
diff --git a/t/t6027-merge-binary.sh b/t/t6407-merge-binary.sh
similarity index 100%
rename from t/t6027-merge-binary.sh
rename to t/t6407-merge-binary.sh
diff --git a/t/t6028-merge-up-to-date.sh b/t/t6408-merge-up-to-date.sh
similarity index 100%
rename from t/t6028-merge-up-to-date.sh
rename to t/t6408-merge-up-to-date.sh
diff --git a/t/t6029-merge-subtree.sh b/t/t6409-merge-subtree.sh
similarity index 100%
rename from t/t6029-merge-subtree.sh
rename to t/t6409-merge-subtree.sh
diff --git a/t/t6031-merge-filemode.sh b/t/t6411-merge-filemode.sh
similarity index 100%
rename from t/t6031-merge-filemode.sh
rename to t/t6411-merge-filemode.sh
diff --git a/t/t6032-merge-large-rename.sh b/t/t6412-merge-large-rename.sh
similarity index 100%
rename from t/t6032-merge-large-rename.sh
rename to t/t6412-merge-large-rename.sh
diff --git a/t/t6033-merge-crlf.sh b/t/t6413-merge-crlf.sh
similarity index 100%
rename from t/t6033-merge-crlf.sh
rename to t/t6413-merge-crlf.sh
diff --git a/t/t6034-merge-rename-nocruft.sh b/t/t6414-merge-rename-nocruft.sh
similarity index 100%
rename from t/t6034-merge-rename-nocruft.sh
rename to t/t6414-merge-rename-nocruft.sh
diff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
similarity index 100%
rename from t/t6035-merge-dir-to-symlink.sh
rename to t/t6415-merge-dir-to-symlink.sh
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
similarity index 100%
rename from t/t6036-recursive-corner-cases.sh
rename to t/t6416-recursive-corner-cases.sh
diff --git a/t/t6037-merge-ours-theirs.sh b/t/t6417-merge-ours-theirs.sh
similarity index 100%
rename from t/t6037-merge-ours-theirs.sh
rename to t/t6417-merge-ours-theirs.sh
diff --git a/t/t6038-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
similarity index 100%
rename from t/t6038-merge-text-auto.sh
rename to t/t6418-merge-text-auto.sh
diff --git a/t/t6039-merge-ignorecase.sh b/t/t6419-merge-ignorecase.sh
similarity index 100%
rename from t/t6039-merge-ignorecase.sh
rename to t/t6419-merge-ignorecase.sh
diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
similarity index 100%
rename from t/t6042-merge-rename-corner-cases.sh
rename to t/t6422-merge-rename-corner-cases.sh
diff --git a/t/t6043-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
similarity index 100%
rename from t/t6043-merge-rename-directories.sh
rename to t/t6423-merge-rename-directories.sh
diff --git a/t/t6044-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh
similarity index 100%
rename from t/t6044-merge-unrelated-index-changes.sh
rename to t/t6424-merge-unrelated-index-changes.sh
diff --git a/t/t6045-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
similarity index 100%
rename from t/t6045-merge-rename-delete.sh
rename to t/t6425-merge-rename-delete.sh
diff --git a/t/t6046-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
similarity index 100%
rename from t/t6046-merge-skip-unneeded-updates.sh
rename to t/t6426-merge-skip-unneeded-updates.sh
diff --git a/t/t6047-diff3-conflict-markers.sh b/t/t6427-diff3-conflict-markers.sh
similarity index 100%
rename from t/t6047-diff3-conflict-markers.sh
rename to t/t6427-diff3-conflict-markers.sh
diff --git a/t/t3030-merge-recursive.sh b/t/t6430-merge-recursive.sh
similarity index 100%
rename from t/t3030-merge-recursive.sh
rename to t/t6430-merge-recursive.sh
diff --git a/t/t3031-merge-criscross.sh b/t/t6431-merge-criscross.sh
similarity index 100%
rename from t/t3031-merge-criscross.sh
rename to t/t6431-merge-criscross.sh
diff --git a/t/t3032-merge-recursive-space-options.sh b/t/t6432-merge-recursive-space-options.sh
similarity index 100%
rename from t/t3032-merge-recursive-space-options.sh
rename to t/t6432-merge-recursive-space-options.sh
diff --git a/t/t3033-merge-toplevel.sh b/t/t6433-merge-toplevel.sh
similarity index 100%
rename from t/t3033-merge-toplevel.sh
rename to t/t6433-merge-toplevel.sh
diff --git a/t/t3034-merge-recursive-rename-options.sh b/t/t6434-merge-recursive-rename-options.sh
similarity index 100%
rename from t/t3034-merge-recursive-rename-options.sh
rename to t/t6434-merge-recursive-rename-options.sh
diff --git a/t/t3035-merge-sparse.sh b/t/t6435-merge-sparse.sh
similarity index 100%
rename from t/t3035-merge-sparse.sh
rename to t/t6435-merge-sparse.sh
diff --git a/t/t7607-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
similarity index 100%
rename from t/t7607-merge-overwrite.sh
rename to t/t6436-merge-overwrite.sh
diff --git a/t/t7405-submodule-merge.sh b/t/t6437-submodule-merge.sh
similarity index 100%
rename from t/t7405-submodule-merge.sh
rename to t/t6437-submodule-merge.sh
diff --git a/t/t7613-merge-submodule.sh b/t/t6438-submodule-directory-file-conflicts.sh
similarity index 100%
rename from t/t7613-merge-submodule.sh
rename to t/t6438-submodule-directory-file-conflicts.sh
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t6439-merge-co-error-msgs.sh
similarity index 100%
rename from t/t7609-merge-co-error-msgs.sh
rename to t/t6439-merge-co-error-msgs.sh
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH v3 02/11] t6418: tighten delete/normalize conflict testcase
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
                       ` (8 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

The testcase only required that the merge complete without conflict,
without specifying what the correct resolution was.  Since normalization
changed this from a modify/delete to a not-modified/delete, the correct
resolution is to have the file be removed at the end.  Add a check for
this resolution.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6418-merge-text-auto.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t6418-merge-text-auto.sh b/t/t6418-merge-text-auto.sh
index 89c86d4e56..30983d18b1 100755
--- a/t/t6418-merge-text-auto.sh
+++ b/t/t6418-merge-text-auto.sh
@@ -197,7 +197,8 @@ test_expect_success 'Test delete/normalize conflict' '
 	git commit -m "remove file" &&
 	git checkout master &&
 	git reset --hard a^ &&
-	git merge side
+	git merge side &&
+	test_path_is_missing file
 '
 
 test_done
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 03/11] t6422: fix bad check against missing file
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
                       ` (7 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index f163893ff9..7da75c1736 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -906,7 +906,7 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git rev-parse >expect \
 			B:bar  A:bar  &&
 
-		test_cmp file_is_missing foo &&
+		test_path_is_missing foo &&
 		# bar should have two-way merged contents of the different
 		# versions of bar; check that content from both sides is
 		# present.
@@ -974,8 +974,8 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git rev-parse >expect \
 			O:foo  O:bar  &&
 
-		test_cmp file_is_missing foo &&
-		test_cmp file_is_missing bar &&
+		test_path_is_missing foo &&
+		test_path_is_missing bar &&
 		# baz should have two-way merged contents of the original
 		# contents of foo and bar; check that content from both sides
 		# is present.
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 04/11] t6416, t6422: fix incorrect untracked file count
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (2 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
                       ` (6 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Apparently I don't know how to count untracked files, and since the
tests in question were marked as test_expect_failure, no one ever
noticed it until now.  Correct the count, as these tests clearly create
three untracked files ('out', 'err', and 'file_count').

(I believe this problem arose because earlier incarnations counted lines
via a pipe to 'wc -l'.  Reviewers asked that it be replaced by writing
the output to a file and using test_line_count, but when the temporary
output was added to a separate file, the count of untracked files should
have increased.)

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6416-recursive-corner-cases.sh    | 2 +-
 t/t6422-merge-rename-corner-cases.sh | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index b3bf462617..d272b418e4 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -1144,7 +1144,7 @@ test_expect_failure 'check symlink add/add' '
 		test_must_fail git merge -s recursive E^0 &&
 
 		git ls-files -s >out &&
-		test_line_count = 2 out &&
+		test_line_count = 3 out &&
 		git ls-files -u >out &&
 		test_line_count = 2 out &&
 		git ls-files -o >out &&
diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 7da75c1736..c8ee033ad9 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -899,7 +899,7 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git ls-files -u >file_count &&
 		test_line_count = 2 file_count &&
 		git ls-files -o >file_count &&
-		test_line_count = 2 file_count &&
+		test_line_count = 3 file_count &&
 
 		git rev-parse >actual \
 			:2:bar :3:bar &&
@@ -967,7 +967,7 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git ls-files -u >file_count &&
 		test_line_count = 2 file_count &&
 		git ls-files -o >file_count &&
-		test_line_count = 2 file_count &&
+		test_line_count = 3 file_count &&
 
 		git rev-parse >actual \
 			:2:baz :3:baz &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 05/11] t6423: fix test setup for a couple tests
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (3 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
                       ` (5 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Commit da1e295e00 ("t604[236]: do not run setup in separate tests",
2019-10-22) removed approximately half the tests (which were setup-only
tests) in t6043 by turning them into functions that the subsequent test
would call as their first step.  This ensured that any test from this
file could be run entirely independently of all the other tests in the
file.  Unfortunately, the call to the new setup function was missed in
two of the test_expect_failure cases.  Add them in.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6423-merge-rename-directories.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 83792c5ef1..d227e15944 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2880,6 +2880,7 @@ test_setup_9g () {
 }
 
 test_expect_failure '9g: Renamed directory that only contained immediate subdirs, immediate subdirs renamed' '
+	test_setup_9g &&
 	(
 		cd 9g &&
 
@@ -3362,6 +3363,7 @@ test_setup_10e () {
 }
 
 test_expect_failure '10e: Does git complain about untracked file that is not really in the way?' '
+	test_setup_10e &&
 	(
 		cd 10e &&
 
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 06/11] t6422: fix multiple errors with the mod6 test expectations
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (4 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
                       ` (4 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

This test had multiple issues causing it to fail for the wrong
reason(s):

  * rename/rename(1to2) conflicts have always left the original source
    path present in the working directory and index (at stage 1).  Thus,
    the triple rename/rename(1to2) should result in 9 unstaged files,
    not 6.
  * It messed up the three-way content merge for checking the results of
    merging for one of the renames, accidentally turning it into a
    two-way merge.
  * It got the contents of the base files it was using to compare
    against wrong, due to an off-by-one error, and overwrite-redirection
    ('>') instead of append-redirection ('>>').
  * It used slightly too-long conflict markers
  * It didn't include filenames in the conflict marker hunks (granted,
    that was a shortcoming of the merge-recursive backend for rename/add
    and rename/rename(2to1) conflicts, but since it's
    test_expect_failure anyway we might as well make it expect our
    preferred behavior rather than some compromise that we can't yet
    reach anyway).

Fix these issues so that a merge backend which correctly handles these
kinds of nested conflicts will pass the test.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index c8ee033ad9..2413f517e7 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -1042,25 +1042,25 @@ test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename
 		test_must_be_empty err &&
 
 		git ls-files -s >file_count &&
-		test_line_count = 6 file_count &&
+		test_line_count = 9 file_count &&
 		git ls-files -u >file_count &&
-		test_line_count = 6 file_count &&
+		test_line_count = 9 file_count &&
 		git ls-files -o >file_count &&
 		test_line_count = 3 file_count &&
 
 		test_seq 10 20 >merged-one &&
 		test_seq 51 60 >merged-five &&
 		# Determine what the merge of three would give us.
-		test_seq 30 40 >three-side-A &&
+		test_seq 31 39 >three-base &&
+		test_seq 31 40 >three-side-A &&
 		test_seq 31 39 >three-side-B &&
-		echo forty >three-side-B &&
-		>empty &&
+		echo forty >>three-side-B &&
 		test_must_fail git merge-file \
-			-L "HEAD" \
+			-L "HEAD:four" \
 			-L "" \
-			-L "B^0" \
-			three-side-A empty three-side-B &&
-		sed -e "s/^\([<=>]\)/\1\1\1/" three-side-A >merged-three &&
+			-L "B^0:two" \
+			three-side-A three-base three-side-B &&
+		sed -e "s/^\([<=>]\)/\1\1/" three-side-A >merged-three &&
 
 		# Verify the index is as expected
 		git rev-parse >actual         \
@@ -1075,6 +1075,7 @@ test_expect_failure 'mod6-check: chains of rename/rename(1to2) and rename/rename
 
 		git cat-file -p :2:two >expect &&
 		git cat-file -p :3:two >other &&
+		>empty &&
 		test_must_fail git merge-file    \
 			-L "HEAD"  -L ""  -L "B^0" \
 			expect     empty  other &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 07/11] t6416, t6423: clarify some comments and fix some typos
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (5 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
                       ` (3 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6416-recursive-corner-cases.sh   |  2 +-
 t/t6423-merge-rename-directories.sh | 25 ++++++++++++-------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/t/t6416-recursive-corner-cases.sh b/t/t6416-recursive-corner-cases.sh
index d272b418e4..fd98989b14 100755
--- a/t/t6416-recursive-corner-cases.sh
+++ b/t/t6416-recursive-corner-cases.sh
@@ -452,7 +452,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev
 #
 # So choice 5 at least provides some kind of conflict for the original case,
 # and can merge cleanly as expected with D1 and E3.  It also made things just
-# slightly funny for merging D1 and e$, where E4 is defined as:
+# slightly funny for merging D1 and E4, where E4 is defined as:
 #   Commit E4: Merge B & C, modifying 'a' and renaming to 'a2', and deleting 'a/'
 # in this case, we'll get a rename/rename(1to2) conflict because a~$UNIQUE
 # gets renamed to 'a' in D1 and to 'a2' in E4.  But that's better than having
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index d227e15944..bd0f17a3be 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2260,24 +2260,23 @@ test_expect_success '8d: rename/delete...or not?' '
 #   Commit B: w/{b,c}, z/d
 #
 # Possible Resolutions:
-#   w/o dir-rename detection: z/d, CONFLICT(z/b -> y/b vs. w/b),
-#                                  CONFLICT(z/c -> y/c vs. w/c)
-#   Currently expected:       y/d, CONFLICT(z/b -> y/b vs. w/b),
-#                                  CONFLICT(z/c -> y/c vs. w/c)
-#   Optimal:                  ??
+#   if z not considered renamed: z/d, CONFLICT(z/b -> y/b vs. w/b),
+#                                     CONFLICT(z/c -> y/c vs. w/c)
+#   if z->y rename considered:   y/d, CONFLICT(z/b -> y/b vs. w/b),
+#                                     CONFLICT(z/c -> y/c vs. w/c)
+#   Optimal:                     ??
 #
 # Notes: In commit A, directory z got renamed to y.  In commit B, directory z
 #        did NOT get renamed; the directory is still present; instead it is
 #        considered to have just renamed a subset of paths in directory z
-#        elsewhere.  Therefore, the directory rename done in commit A to z/
-#        applies to z/d and maps it to y/d.
+#        elsewhere.  However, this is much like testcase 6b (where commit B
+#        moves all the original paths out of z/ but opted to keep d
+#        within z/).  This makes it hard to judge where d should end up.
 #
 #        It's possible that users would get confused about this, but what
-#        should we do instead?  Silently leaving at z/d seems just as bad or
-#        maybe even worse.  Perhaps we could print a big warning about z/d
-#        and how we're moving to y/d in this case, but when I started thinking
-#        about the ramifications of doing that, I didn't know how to rule out
-#        that opening other weird edge and corner cases so I just punted.
+#        should we do instead?  It's not at all clear to me whether z/d or
+#        y/d or something else is a better resolution here, and other cases
+#        start getting really tricky, so I just picked one.
 
 test_setup_8e () {
 	test_create_repo 8e &&
@@ -4405,7 +4404,7 @@ test_expect_success '13b(info): messages for transitive rename with conflicted c
 #   Commit O: z/{b,c},   x/{d,e}
 #   Commit A: y/{b,c,d}, x/e
 #   Commit B: z/{b,c,d}, x/e
-#   Expected: y/{b,c,d}, with info or conflict messages for d (
+#   Expected: y/{b,c,d}, x/e, with info or conflict messages for d
 #             A: renamed x/d -> z/d; B: renamed z/ -> y/ AND renamed x/d to y/d
 #             One could argue A had partial knowledge of what was done with
 #             d and B had full knowledge, but that's a slippery slope as
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 08/11] t6423: add an explanation about why one of the tests does not pass
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (6 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
                       ` (2 subsequent siblings)
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

I had long since forgotten the idea behind this test and why it failed,
and took a little while to figure it out.  To prevent others from having
to spend a similar time on it, add an explanation in the comments.
However, the reasoning in the explanation makes me question why I
considered it a failure at all.  I'm not sure if I had a better reason
when I originally wrote it, but for now just add commentary about the
possible expectations and why it behaves the way it does right now.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6423-merge-rename-directories.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index bd0f17a3be..2b4a482277 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -2843,6 +2843,14 @@ test_expect_success '9f: Renamed directory that only contained immediate subdirs
 #   Commit A: priority/{alpha,bravo}/$more_files
 #   Commit B: goal/{a,b}/$more_files, goal/c
 #   Expected: priority/{alpha,bravo}/$more_files, priority/c
+# We currently fail this test because the directory renames we detect are
+#   goal/a/ -> priority/alpha/
+#   goal/b/ -> priority/bravo/
+# We do not detect
+#   goal/   -> priority/
+# because of no files found within goal/, and the fact that "a" != "alpha"
+# and "b" != "bravo".  But I'm not sure it's really a failure given that
+# viewpoint...
 
 test_setup_9g () {
 	test_create_repo 9g &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (7 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

merge-recursive treats an add/add conflict where one of the adds came
from a rename as a separate 'rename/add' type of conflict.  However, if
there is not content conflict after the content merge(s), then the file
is not considered to be conflicted.  That suggests the conflict type is
really just add/add.  Other merge engines might choose to print messages
to the console that just refer to these as add/add conflicts; accept
both types of output.

Note: it could help to notify users if the three-way content merge of
the rename had content conflicts, because when we then go to two-way
merge THAT with the conflicting add we can get nested conflict markers.
merge-recursive, unfortunately, doesn't do that, but other merge engines
could.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh   | 21 +++++++++++++--------
 t/t6426-merge-skip-unneeded-updates.sh |  2 +-
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index 2413f517e7..f3929b65c0 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -457,7 +457,7 @@ test_expect_success 'handle rename-with-content-merge vs. add' '
 		git checkout A^0 &&
 
 		test_must_fail git merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -503,7 +503,7 @@ test_expect_success 'handle rename-with-content-merge vs. add, merge other way'
 		git checkout B^0 &&
 
 		test_must_fail git merge -s recursive A^0 >out &&
-		test_i18ngrep "CONFLICT (rename/add)" out &&
+		test_i18ngrep "CONFLICT (.*/add)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -886,12 +886,17 @@ test_expect_failure 'rad-check: rename/add/delete conflict' '
 		git checkout B^0 &&
 		test_must_fail git merge -s recursive A^0 >out 2>err &&
 
-		# Not sure whether the output should contain just one
-		# "CONFLICT (rename/add/delete)" line, or if it should break
-		# it into a pair of "CONFLICT (rename/delete)" and
-		# "CONFLICT (rename/add)"; allow for either.
-		test_i18ngrep "CONFLICT (rename.*add)" out &&
-		test_i18ngrep "CONFLICT (rename.*delete)" out &&
+		# Instead of requiring the output to contain one combined line
+		#   CONFLICT (rename/add/delete)
+		# or perhaps two lines:
+		#   CONFLICT (rename/add): new file collides with rename target
+		#   CONFLICT (rename/delete): rename source removed on other side
+		# and instead of requiring "rename/add" instead of "add/add",
+		# be flexible in the type of console output message(s) reported
+		# for this particular case; we will be more stringent about the
+		# contents of the index and working directory.
+		test_i18ngrep "CONFLICT (.*/add)" out &&
+		test_i18ngrep "CONFLICT (rename.*/delete)" out &&
 		test_must_be_empty err &&
 
 		git ls-files -s >file_count &&
diff --git a/t/t6426-merge-skip-unneeded-updates.sh b/t/t6426-merge-skip-unneeded-updates.sh
index 5a2d07e516..699813671c 100755
--- a/t/t6426-merge-skip-unneeded-updates.sh
+++ b/t/t6426-merge-skip-unneeded-updates.sh
@@ -374,7 +374,7 @@ test_expect_success '2c: Modify b & add c VS rename b->c' '
 		export GIT_MERGE_VERBOSITY &&
 		test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-		test_i18ngrep "CONFLICT (rename/add): Rename b->c" out &&
+		test_i18ngrep "CONFLICT (.*/add):" out &&
 		test_must_be_empty err &&
 
 		# Make sure c WAS updated
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (8 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  2020-08-10 22:29     ` [PATCH v3 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

Much like the last commit accepted 'add/add' and 'rename/add'
interchangably, we also want to do the same for 'add/add' and
'rename/rename'.  This also allows us to avoid the ambiguity in meaning
with 'rename/rename' (is it two separate files renamed to the same
location, or one file renamed on both sides but differently)?

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6422-merge-rename-corner-cases.sh | 18 ++++++++++++------
 t/t6423-merge-rename-directories.sh  |  4 ++--
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/t/t6422-merge-rename-corner-cases.sh b/t/t6422-merge-rename-corner-cases.sh
index f3929b65c0..3375eaf4e7 100755
--- a/t/t6422-merge-rename-corner-cases.sh
+++ b/t/t6422-merge-rename-corner-cases.sh
@@ -583,7 +583,7 @@ test_expect_success 'handle rename/rename (2to1) conflict correctly' '
 		git checkout B^0 &&
 
 		test_must_fail git merge -s recursive C^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 2 out &&
@@ -959,11 +959,17 @@ test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' '
 		git checkout A^0 &&
 		test_must_fail git merge -s recursive B^0 >out 2>err &&
 
-		# Not sure whether the output should contain just one
-		# "CONFLICT (rename/rename/delete/delete)" line, or if it
-		# should break it into three: "CONFLICT (rename/rename)" and
-		# two "CONFLICT (rename/delete)" lines; allow for either.
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		# Instead of requiring the output to contain one combined line
+		#   CONFLICT (rename/rename/delete/delete)
+		# or perhaps two lines:
+		#   CONFLICT (rename/rename): ...
+		#   CONFLICT (rename/delete): info about pair 1
+		#   CONFLICT (rename/delete): info about pair 2
+		# and instead of requiring "rename/rename" instead of "add/add",
+		# be flexible in the type of console output message(s) reported
+		# for this particular case; we will be more stringent about the
+		# contents of the index and working directory.
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 		test_i18ngrep "CONFLICT (rename.*delete)" out &&
 		test_must_be_empty err &&
 
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index 2b4a482277..f7ecbb886d 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -275,7 +275,7 @@ test_expect_success '1d: Directory renames cause a rename/rename(2to1) conflict'
 		git checkout A^0 &&
 
 		test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 8 out &&
@@ -1686,7 +1686,7 @@ test_expect_success '7b: rename/rename(2to1), but only due to transitive rename'
 		git checkout A^0 &&
 
 		test_must_fail git -c merge.directoryRenames=true merge -s recursive B^0 >out &&
-		test_i18ngrep "CONFLICT (rename/rename)" out &&
+		test_i18ngrep "CONFLICT (\(.*\)/\1)" out &&
 
 		git ls-files -s >out &&
 		test_line_count = 4 out &&
-- 
gitgitgadget


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH v3 11/11] t6425: be more flexible with rename/delete conflict messages
  2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
                       ` (9 preceding siblings ...)
  2020-08-10 22:29     ` [PATCH v3 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
@ 2020-08-10 22:29     ` Elijah Newren via GitGitGadget
  10 siblings, 0 replies; 28+ messages in thread
From: Elijah Newren via GitGitGadget @ 2020-08-10 22:29 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Elijah Newren

From: Elijah Newren <newren@gmail.com>

t6425 was very picky about the exact output message produced by a
rename/delete conflict, in a way that just scratches the surface of the
mess that was built into merge-recursive.  The idea was that it would
try to find the possible combinations of different conflict types, and
when more than one was present for one path, it would try to provide a
combined message that covered all the cases.

There's a lot to unravel here...

First, there's a basic conflict type known as modify/delete, which is a
content conflict.  It occurs when one side deletes a file, but the other
modifies it.

There is also a path conflict known as a rename/delete.  This occurs
when one side deletes a path, and the other renames it.  This is not a
content conflict, it is a path conflict.  It will often occur in
combination with a content conflict, though, namely a modify/delete.  As
such, these two were often combined.

Another type of conflict that can exist is a directory/file conflict.
For example, one side adds a new file at some path, and the other side
of history adds a directory at the same path.  The path that was "added"
could have been put there by a rename, though.  Thus, we have the
possibility of a single path being affected by a modify/delete, a
rename/delete, and a directory/file conflict.

In part, this was a natural by-product of merge-recursive's design.
Since it was doing a four way merge with the contents of the working
tree being the fourth factor it had to consider, it had working tree
handling spread all over the code.  It also had directory/file conflict
handling spread everywhere through all the other types of conflicts.
And our testsuite has a huge number of directory/file conflict tests
because trying to get them right required modifying so many different
codepaths.  A natural outgrowth of this kind of structure is conflict
messages that combine all the different types that the current codepath
is considering.

However, if we want to make the different conflict types orthogonal and
avoid repeating ourselves and getting very brittle code, then we need to
split the messages from these different conflict types apart.  Besides,
trying to determine all possible permutations is a _royal_ mess.  The
code to handle the rename/delete/directory/file conflict output is
already somewhat hard to parse, and is somewhat brittle.  But if we
really wanted to go that route, then we'd have to have special handling
for the following types of combinations:
  * rename/add/delete:
      on side of history that didn't rename the given file, remove the file
      instead and place an unrelated file in the way of the rename
  * rename/rename(2to1)/mode conflict/delete/delete:
      two different files, one executable and the other not, are renamed
      to the same location, each side deletes the source file that the
      other side renames
  * rename/rename(1to2)/add/add:
      file renamed differently on each side of history, with each side
      placing an unrelated file in the way of the other
  * rename/rename(1to2)/content conflict/file location/(D/F)/(D/F)/:
      both sides modify a file in conflicting way, both rename that file
      but to different paths, one side renames the directory which the
      other side had renamed that file into causing it to possibly need a
      transitive rename, and each side puts a directory in the way of the
      other's path.

Let's back away from this path of insanity, and allow the different
types of conflicts to be handled by separate pieces of non-repeated code
by allowing the conflict messages to be split into their separate types.
(If multiple conflict types affect a single path, the conflict messages
can be printed sequentially.)  Start this path with a simple change:
modify this test to be more flexible and accept the output either merge
backend (recursive or the new ort) will produce.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 t/t6425-merge-rename-delete.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t6425-merge-rename-delete.sh b/t/t6425-merge-rename-delete.sh
index 5d33577d2f..f79d021590 100755
--- a/t/t6425-merge-rename-delete.sh
+++ b/t/t6425-merge-rename-delete.sh
@@ -17,7 +17,8 @@ test_expect_success 'rename/delete' '
 	git commit -m "delete" &&
 
 	test_must_fail git merge --strategy=recursive rename >output &&
-	test_i18ngrep "CONFLICT (rename/delete): A deleted in HEAD and renamed to B in rename. Version rename of B left in tree." output
+	test_i18ngrep "CONFLICT (rename/delete): A.* renamed .*to B.* in rename" output &&
+	test_i18ngrep "CONFLICT (rename/delete): A.*deleted in HEAD." output
 '
 
 test_done
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-08-10 22:29 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 16:29 [PATCH] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-08 17:01 ` [PATCH v2 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
2020-08-09  2:30     ` Eric Sunshine
2020-08-08 17:01   ` [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
2020-08-09  3:12     ` Eric Sunshine
2020-08-09  5:34       ` Elijah Newren
2020-08-08 17:01   ` [PATCH v2 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
2020-08-08 17:01   ` [PATCH v2 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget
2020-08-10 22:29   ` [PATCH v3 00/11] Start preparing merge-related tests to work with multiple merge backends Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 01/11] Collect merge-related tests to t64xx Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 02/11] t6418: tighten delete/normalize conflict testcase Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 03/11] t6422: fix bad check against missing file Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 04/11] t6416, t6422: fix incorrect untracked file count Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 05/11] t6423: fix test setup for a couple tests Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 06/11] t6422: fix multiple errors with the mod6 test expectations Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 07/11] t6416, t6423: clarify some comments and fix some typos Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 08/11] t6423: add an explanation about why one of the tests does not pass Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 09/11] t6422, t6426: be more flexible for add/add conflicts involving renames Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 10/11] t642[23]: be more flexible for add/add conflicts involving pair renames Elijah Newren via GitGitGadget
2020-08-10 22:29     ` [PATCH v3 11/11] t6425: be more flexible with rename/delete conflict messages Elijah Newren via GitGitGadget

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).