Collect merge-related tests to t64xx
PATCH 1/1 Collect merge-related tests to t64xx
From: Elijah Newren <[email protected]>
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.
---
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%)t/t6400-merge-df.sh renamed from t/t6020-merge-df.sh +0 -0
t/t6401-merge-criss-cross.sh renamed from t/t6021-merge-criss-cross.sh +0 -0
t/t6402-merge-rename.sh renamed from t/t6022-merge-rename.sh +0 -0
t/t6403-merge-file.sh renamed from t/t6023-merge-file.sh +0 -0
t/t6404-recursive-merge.sh renamed from t/t6024-recursive-merge.sh +0 -0
t/t6405-merge-symlinks.sh renamed from t/t6025-merge-symlinks.sh +0 -0
t/t6406-merge-attr.sh renamed from t/t6026-merge-attr.sh +0 -0
t/t6407-merge-binary.sh renamed from t/t6027-merge-binary.sh +0 -0
t/t6408-merge-up-to-date.sh renamed from t/t6028-merge-up-to-date.sh +0 -0
t/t6409-merge-subtree.sh renamed from t/t6029-merge-subtree.sh +0 -0
t/t6411-merge-filemode.sh renamed from t/t6031-merge-filemode.sh +0 -0
t/t6412-merge-large-rename.sh renamed from t/t6032-merge-large-rename.sh +0 -0
t/t6413-merge-crlf.sh renamed from t/t6033-merge-crlf.sh +0 -0
t/t6414-merge-rename-nocruft.sh renamed from t/t6034-merge-rename-nocruft.sh +0 -0
t/t6415-merge-dir-to-symlink.sh renamed from t/t6035-merge-dir-to-symlink.sh +0 -0
t/t6416-recursive-corner-cases.sh renamed from t/t6036-recursive-corner-cases.sh +0 -0
t/t6417-merge-ours-theirs.sh renamed from t/t6037-merge-ours-theirs.sh +0 -0
t/t6418-merge-text-auto.sh renamed from t/t6038-merge-text-auto.sh +0 -0
t/t6419-merge-ignorecase.sh renamed from t/t6039-merge-ignorecase.sh +0 -0
t/t6422-merge-rename-corner-cases.sh renamed from t/t6042-merge-rename-corner-cases.sh +0 -0
t/t6423-merge-rename-directories.sh renamed from t/t6043-merge-rename-directories.sh +0 -0
t/t6424-merge-unrelated-index-changes.sh renamed from t/t6044-merge-unrelated-index-changes.sh +0 -0
t/t6425-merge-rename-delete.sh renamed from t/t6045-merge-rename-delete.sh +0 -0
t/t6426-merge-skip-unneeded-updates.sh renamed from t/t6046-merge-skip-unneeded-updates.sh +0 -0
t/t6427-diff3-conflict-markers.sh renamed from t/t6047-diff3-conflict-markers.sh +0 -0
t/t6430-merge-recursive.sh renamed from t/t3030-merge-recursive.sh +0 -0
t/t6431-merge-criscross.sh renamed from t/t3031-merge-criscross.sh +0 -0
t/t6432-merge-recursive-space-options.sh renamed from t/t3032-merge-recursive-space-options.sh +0 -0
t/t6433-merge-toplevel.sh renamed from t/t3033-merge-toplevel.sh +0 -0
t/t6434-merge-recursive-rename-options.sh renamed from t/t3034-merge-recursive-rename-options.sh +0 -0
t/t6435-merge-sparse.sh renamed from t/t3035-merge-sparse.sh +0 -0
t/t6436-merge-overwrite.sh renamed from t/t7607-merge-overwrite.sh +0 -0
t/t6437-submodule-merge.sh renamed from t/t7405-submodule-merge.sh +0 -0
t/t6438-submodule-directory-file-conflicts.sh renamed from t/t7613-merge-submodule.sh +0 -0
t/t6439-merge-co-error-msgs.sh renamed from t/t7609-merge-co-error-msgs.sh +0 -0
base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3
Signature · 1 line
gitgitgadget
v2 cover Start preparing merge-related tests to work with multiple merge backends
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
Signature · 1 line
gitgitgadget
PATCH v2 1/11 Collect merge-related tests to t64xx
From: Elijah Newren <[email protected]>
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.
---
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%)t/t6400-merge-df.sh renamed from t/t6020-merge-df.sh +0 -0
t/t6401-merge-criss-cross.sh renamed from t/t6021-merge-criss-cross.sh +0 -0
t/t6402-merge-rename.sh renamed from t/t6022-merge-rename.sh +0 -0
t/t6403-merge-file.sh renamed from t/t6023-merge-file.sh +0 -0
t/t6404-recursive-merge.sh renamed from t/t6024-recursive-merge.sh +0 -0
t/t6405-merge-symlinks.sh renamed from t/t6025-merge-symlinks.sh +0 -0
t/t6406-merge-attr.sh renamed from t/t6026-merge-attr.sh +0 -0
t/t6407-merge-binary.sh renamed from t/t6027-merge-binary.sh +0 -0
t/t6408-merge-up-to-date.sh renamed from t/t6028-merge-up-to-date.sh +0 -0
t/t6409-merge-subtree.sh renamed from t/t6029-merge-subtree.sh +0 -0
t/t6411-merge-filemode.sh renamed from t/t6031-merge-filemode.sh +0 -0
t/t6412-merge-large-rename.sh renamed from t/t6032-merge-large-rename.sh +0 -0
t/t6413-merge-crlf.sh renamed from t/t6033-merge-crlf.sh +0 -0
t/t6414-merge-rename-nocruft.sh renamed from t/t6034-merge-rename-nocruft.sh +0 -0
t/t6415-merge-dir-to-symlink.sh renamed from t/t6035-merge-dir-to-symlink.sh +0 -0
t/t6416-recursive-corner-cases.sh renamed from t/t6036-recursive-corner-cases.sh +0 -0
t/t6417-merge-ours-theirs.sh renamed from t/t6037-merge-ours-theirs.sh +0 -0
t/t6418-merge-text-auto.sh renamed from t/t6038-merge-text-auto.sh +0 -0
t/t6419-merge-ignorecase.sh renamed from t/t6039-merge-ignorecase.sh +0 -0
t/t6422-merge-rename-corner-cases.sh renamed from t/t6042-merge-rename-corner-cases.sh +0 -0
t/t6423-merge-rename-directories.sh renamed from t/t6043-merge-rename-directories.sh +0 -0
t/t6424-merge-unrelated-index-changes.sh renamed from t/t6044-merge-unrelated-index-changes.sh +0 -0
t/t6425-merge-rename-delete.sh renamed from t/t6045-merge-rename-delete.sh +0 -0
t/t6426-merge-skip-unneeded-updates.sh renamed from t/t6046-merge-skip-unneeded-updates.sh +0 -0
t/t6427-diff3-conflict-markers.sh renamed from t/t6047-diff3-conflict-markers.sh +0 -0
t/t6430-merge-recursive.sh renamed from t/t3030-merge-recursive.sh +0 -0
t/t6431-merge-criscross.sh renamed from t/t3031-merge-criscross.sh +0 -0
t/t6432-merge-recursive-space-options.sh renamed from t/t3032-merge-recursive-space-options.sh +0 -0
t/t6433-merge-toplevel.sh renamed from t/t3033-merge-toplevel.sh +0 -0
t/t6434-merge-recursive-rename-options.sh renamed from t/t3034-merge-recursive-rename-options.sh +0 -0
t/t6435-merge-sparse.sh renamed from t/t3035-merge-sparse.sh +0 -0
t/t6436-merge-overwrite.sh renamed from t/t7607-merge-overwrite.sh +0 -0
t/t6437-submodule-merge.sh renamed from t/t7405-submodule-merge.sh +0 -0
t/t6438-submodule-directory-file-conflicts.sh renamed from t/t7613-merge-submodule.sh +0 -0
t/t6439-merge-co-error-msgs.sh renamed from t/t7609-merge-co-error-msgs.sh +0 -0
Signature · 1 line
gitgitgadget
PATCH v2 2/11 t6418: tighten delete/normalize conflict testcase
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6418-merge-text-auto.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6418-merge-text-auto.sh +2 -1
@@ -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
Signature · 1 line
gitgitgadget
PATCH v2 3/11 t6422: fix bad check against missing file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- t/t6422-merge-rename-corner-cases.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
t/t6422-merge-rename-corner-cases.sh +3 -3
@@ -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.
Signature · 1 line
gitgitgadget
Re: [PATCH v2 03/11] t6422: fix bad check against missing file
t/t6422-merge-rename-corner-cases.sh test_expect_failure 'rrdd-check: rename/rename(2to1)/delete/delete conflict' ' · line 975
Quoted 8 lines · Elijah Newren via GitGitGadget
Signed-off-by Elijah Newren <[email protected]>---
t/t6422-merge-rename-corner-cases.sh +2
-2@@ -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.)
PATCH v2 4/11 t6416, t6422: fix incorrect untracked file count
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.)
--- t/t6416-recursive-corner-cases.sh | 2 +- t/t6422-merge-rename-corner-cases.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
t/t6416-recursive-corner-cases.sh +1 -1
@@ -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 &&
t/t6422-merge-rename-corner-cases.sh +2 -2
@@ -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 &&
Signature · 1 line
gitgitgadget
Re: [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count
Quoted 4 lines · Elijah Newren via GitGitGadget
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/
Quoted 7 lines
(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 <[email protected]>
Re: [PATCH v2 04/11] t6416, t6422: fix incorrect untracked file count
Quoted 11 lines · Eric Sunshine
Quoted 4 lines · Elijah Newren via GitGitGadget
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.
PATCH v2 5/11 t6423: fix test setup for a couple tests
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6423-merge-rename-directories.sh | 2 ++ 1 file changed, 2 insertions(+)
t/t6423-merge-rename-directories.sh +2 -0
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v2 6/11 t6422: fix multiple errors with the mod6 test expectations
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6422-merge-rename-corner-cases.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
t/t6422-merge-rename-corner-cases.sh +10 -9
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v2 7/11 t6416, t6423: clarify some comments and fix some typos
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- t/t6416-recursive-corner-cases.sh | 2 +- t/t6423-merge-rename-directories.sh | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-)
t/t6416-recursive-corner-cases.sh +1 -1
@@ -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
t/t6423-merge-rename-directories.sh +12 -13
@@ -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
Signature · 1 line
gitgitgadget
PATCH v2 8/11 t6423: add an explanation about why one of the tests does not pass
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6423-merge-rename-directories.sh | 8 ++++++++ 1 file changed, 8 insertions(+)
t/t6423-merge-rename-directories.sh +8 -0
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v2 9/11 t6422, t6426: be more flexible for add/add conflicts involving renames
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6422-merge-rename-corner-cases.sh | 21 +++++++++++++-------- t/t6426-merge-skip-unneeded-updates.sh | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-)
t/t6422-merge-rename-corner-cases.sh +13 -8
@@ -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 &&
t/t6426-merge-skip-unneeded-updates.sh +1 -1
@@ -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
Signature · 1 line
gitgitgadget
PATCH v2 10/11 t642[23]: be more flexible for add/add conflicts involving pair renames
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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)?
--- t/t6422-merge-rename-corner-cases.sh | 18 ++++++++++++------ t/t6423-merge-rename-directories.sh | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-)
t/t6422-merge-rename-corner-cases.sh +12 -6
@@ -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 &&
t/t6423-merge-rename-directories.sh +2 -2
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v2 11/11 t6425: be more flexible with rename/delete conflict messages
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6425-merge-rename-delete.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6425-merge-rename-delete.sh +2 -1
@@ -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
Signature · 1 line
gitgitgadget
v3 cover Start preparing merge-related tests to work with multiple merge backends
In reply to Elijah Newren via GitGitGadgetThis 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.
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
Signature · 1 line
gitgitgadget
PATCH v3 1/11 Collect merge-related tests to t64xx
From: Elijah Newren <[email protected]>
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.
---
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%)t/t6400-merge-df.sh renamed from t/t6020-merge-df.sh +0 -0
t/t6401-merge-criss-cross.sh renamed from t/t6021-merge-criss-cross.sh +0 -0
t/t6402-merge-rename.sh renamed from t/t6022-merge-rename.sh +0 -0
t/t6403-merge-file.sh renamed from t/t6023-merge-file.sh +0 -0
t/t6404-recursive-merge.sh renamed from t/t6024-recursive-merge.sh +0 -0
t/t6405-merge-symlinks.sh renamed from t/t6025-merge-symlinks.sh +0 -0
t/t6406-merge-attr.sh renamed from t/t6026-merge-attr.sh +0 -0
t/t6407-merge-binary.sh renamed from t/t6027-merge-binary.sh +0 -0
t/t6408-merge-up-to-date.sh renamed from t/t6028-merge-up-to-date.sh +0 -0
t/t6409-merge-subtree.sh renamed from t/t6029-merge-subtree.sh +0 -0
t/t6411-merge-filemode.sh renamed from t/t6031-merge-filemode.sh +0 -0
t/t6412-merge-large-rename.sh renamed from t/t6032-merge-large-rename.sh +0 -0
t/t6413-merge-crlf.sh renamed from t/t6033-merge-crlf.sh +0 -0
t/t6414-merge-rename-nocruft.sh renamed from t/t6034-merge-rename-nocruft.sh +0 -0
t/t6415-merge-dir-to-symlink.sh renamed from t/t6035-merge-dir-to-symlink.sh +0 -0
t/t6416-recursive-corner-cases.sh renamed from t/t6036-recursive-corner-cases.sh +0 -0
t/t6417-merge-ours-theirs.sh renamed from t/t6037-merge-ours-theirs.sh +0 -0
t/t6418-merge-text-auto.sh renamed from t/t6038-merge-text-auto.sh +0 -0
t/t6419-merge-ignorecase.sh renamed from t/t6039-merge-ignorecase.sh +0 -0
t/t6422-merge-rename-corner-cases.sh renamed from t/t6042-merge-rename-corner-cases.sh +0 -0
t/t6423-merge-rename-directories.sh renamed from t/t6043-merge-rename-directories.sh +0 -0
t/t6424-merge-unrelated-index-changes.sh renamed from t/t6044-merge-unrelated-index-changes.sh +0 -0
t/t6425-merge-rename-delete.sh renamed from t/t6045-merge-rename-delete.sh +0 -0
t/t6426-merge-skip-unneeded-updates.sh renamed from t/t6046-merge-skip-unneeded-updates.sh +0 -0
t/t6427-diff3-conflict-markers.sh renamed from t/t6047-diff3-conflict-markers.sh +0 -0
t/t6430-merge-recursive.sh renamed from t/t3030-merge-recursive.sh +0 -0
t/t6431-merge-criscross.sh renamed from t/t3031-merge-criscross.sh +0 -0
t/t6432-merge-recursive-space-options.sh renamed from t/t3032-merge-recursive-space-options.sh +0 -0
t/t6433-merge-toplevel.sh renamed from t/t3033-merge-toplevel.sh +0 -0
t/t6434-merge-recursive-rename-options.sh renamed from t/t3034-merge-recursive-rename-options.sh +0 -0
t/t6435-merge-sparse.sh renamed from t/t3035-merge-sparse.sh +0 -0
t/t6436-merge-overwrite.sh renamed from t/t7607-merge-overwrite.sh +0 -0
t/t6437-submodule-merge.sh renamed from t/t7405-submodule-merge.sh +0 -0
t/t6438-submodule-directory-file-conflicts.sh renamed from t/t7613-merge-submodule.sh +0 -0
t/t6439-merge-co-error-msgs.sh renamed from t/t7609-merge-co-error-msgs.sh +0 -0
Signature · 1 line
gitgitgadget
PATCH v3 2/11 t6418: tighten delete/normalize conflict testcase
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6418-merge-text-auto.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6418-merge-text-auto.sh +2 -1
@@ -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
Signature · 1 line
gitgitgadget
PATCH v3 3/11 t6422: fix bad check against missing file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- t/t6422-merge-rename-corner-cases.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
t/t6422-merge-rename-corner-cases.sh +3 -3
@@ -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.
Signature · 1 line
gitgitgadget
PATCH v3 4/11 t6416, t6422: fix incorrect untracked file count
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.)
--- t/t6416-recursive-corner-cases.sh | 2 +- t/t6422-merge-rename-corner-cases.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
t/t6416-recursive-corner-cases.sh +1 -1
@@ -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 &&
t/t6422-merge-rename-corner-cases.sh +2 -2
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v3 5/11 t6423: fix test setup for a couple tests
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6423-merge-rename-directories.sh | 2 ++ 1 file changed, 2 insertions(+)
t/t6423-merge-rename-directories.sh +2 -0
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v3 6/11 t6422: fix multiple errors with the mod6 test expectations
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6422-merge-rename-corner-cases.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
t/t6422-merge-rename-corner-cases.sh +10 -9
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v3 7/11 t6416, t6423: clarify some comments and fix some typos
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- t/t6416-recursive-corner-cases.sh | 2 +- t/t6423-merge-rename-directories.sh | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-)
t/t6416-recursive-corner-cases.sh +1 -1
@@ -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
t/t6423-merge-rename-directories.sh +12 -13
@@ -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
Signature · 1 line
gitgitgadget
PATCH v3 8/11 t6423: add an explanation about why one of the tests does not pass
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6423-merge-rename-directories.sh | 8 ++++++++ 1 file changed, 8 insertions(+)
t/t6423-merge-rename-directories.sh +8 -0
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v3 9/11 t6422, t6426: be more flexible for add/add conflicts involving renames
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6422-merge-rename-corner-cases.sh | 21 +++++++++++++-------- t/t6426-merge-skip-unneeded-updates.sh | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-)
t/t6422-merge-rename-corner-cases.sh +13 -8
@@ -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 &&
t/t6426-merge-skip-unneeded-updates.sh +1 -1
@@ -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
Signature · 1 line
gitgitgadget
PATCH v3 10/11 t642[23]: be more flexible for add/add conflicts involving pair renames
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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)?
--- t/t6422-merge-rename-corner-cases.sh | 18 ++++++++++++------ t/t6423-merge-rename-directories.sh | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-)
t/t6422-merge-rename-corner-cases.sh +12 -6
@@ -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 &&
t/t6423-merge-rename-directories.sh +2 -2
@@ -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 &&
Signature · 1 line
gitgitgadget
PATCH v3 11/11 t6425: be more flexible with rename/delete conflict messages
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
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.
--- t/t6425-merge-rename-delete.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6425-merge-rename-delete.sh +2 -1
@@ -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
Signature · 1 line
gitgitgadget