From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>, Elijah Newren <newren@gmail.com>
Subject: [PATCH 9/9] t6423: add more details about direct resolution of directories
Date: Fri, 23 Oct 2020 16:01:24 +0000 [thread overview]
Message-ID: <2659d1cb987735ec123ca7a82ed7e058e4d6bef0.1603468885.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.769.git.1603468885.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
t/t6423-merge-rename-directories.sh | 37 ++++++++++++++++-------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
index db694a6316..9e51320ee0 100755
--- a/t/t6423-merge-rename-directories.sh
+++ b/t/t6423-merge-rename-directories.sh
@@ -4725,20 +4725,22 @@ test_expect_success '12e: Rename/merge subdir into the root, variant 2' '
# folder/subdir/newsubdir/e_Merge2
# folder/subdir/tweaked/{h,Makefile_SUB_Merge1,newfile.py}
# folder/unchanged/<LOTS OF FILES>
-#
-# Notes: This testcase happens to exercise lots of the
-# optimization-specific codepaths in merge-ort, and also
-# demonstrated a failing of the directory rename detection algorithm
-# in merge-recursive; newfile.c should not get pushed into
-# folder/subdir/newsubdir/, yet merge-recursive put it there because
-# the rename of dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d}
-# looks like
-# dir/ -> folder/,
-# whereas the rename of dir/subdir/e -> folder/subdir/newsubdir/e
-# looks like
-# dir/subdir/ -> folder/subdir/newsubdir/
-# and if we note that newfile.c is found in dir/subdir/, we might
-# overlook the dir/ -> folder/ rule that has more weight.
+# Things being checked here:
+# 1. dir/subdir/newfile.c does not get pushed into folder/subdir/newsubdir/.
+# dir/subdir/{a,b,c,d} -> folder/subdir/{a,b,c,d} looks like
+# dir/ -> folder/,
+# whereas dir/subdir/e -> folder/subdir/newsubdir/e looks like
+# dir/subdir/ -> folder/subdir/newsubdir/
+# and if we note that newfile.c is found in dir/subdir/, we might overlook
+# the dir/ -> folder/ rule that has more weight. Older git versions did
+# this.
+# 2. The code to do trivial directory resolves. Note that
+# dir/subdir/unchanged/ is unchanged and can be deleted, and files in the
+# new folder/subdir/unchanged/ are not needed as a target to any renames.
+# Thus, in the second collect_merge_info_callback() we can just resolve
+# these two directories trivially without recursing.)
+# 3. Exercising the codepaths for caching renames and deletes from one cherry
+# pick and re-applying them in the subsequent one.
test_setup_12f () {
test_create_repo 12f &&
@@ -4803,7 +4805,7 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac
git checkout A^0 &&
git branch Bmod B &&
- git -c merge.directoryRenames=true rebase A Bmod &&
+ GIT_TRACE2_PERF="$(pwd)/trace.output" git -c merge.directoryRenames=true rebase A Bmod &&
echo Checking the pick of B1... &&
@@ -4884,7 +4886,10 @@ test_expect_merge_algorithm failure success '12f: Trivial directory resolve, cac
test_seq 2 12 >e_Merge2 &&
git hash-object e_Merge2 >expect &&
git rev-parse Bmod:folder/subdir/newsubdir/e >actual &&
- test_cmp expect actual
+ test_cmp expect actual &&
+
+ grep region_enter.*collect_merge_info trace.output >collect &&
+ test_line_count = 4 collect
)
'
--
gitgitgadget
next prev parent reply other threads:[~2020-10-23 16:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 16:01 [PATCH 0/9] Support both merge backends in the testsuite, via environment variable Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 1/9] t/: new helper for tests that pass with ort but fail with recursive Elijah Newren via GitGitGadget
2020-10-23 16:48 ` Junio C Hamano
2020-10-23 17:25 ` Elijah Newren
2020-10-23 18:27 ` Elijah Newren
2020-10-24 10:49 ` Đoàn Trần Công Danh
2020-10-24 16:53 ` Elijah Newren
2020-10-25 13:49 ` Đoàn Trần Công Danh
2020-10-26 14:56 ` Elijah Newren
2020-10-26 17:43 ` Junio C Hamano
2020-10-23 16:01 ` [PATCH 2/9] merge tests: expect improved directory/file conflict handling in ort Elijah Newren via GitGitGadget
2020-10-23 17:40 ` Elijah Newren
2020-10-23 16:01 ` [PATCH 3/9] t6416: correct expectation for rename/rename(1to2) + directory/file Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 4/9] t6404, t6423: expect improved rename/delete handling in ort backend Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 5/9] t6423: expect improved conflict markers labels in the " Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 6/9] merge tests: expect slight differences in output for recursive vs. ort Elijah Newren via GitGitGadget
2020-10-24 16:06 ` Elijah Newren
2020-10-23 16:01 ` [PATCH 7/9] t6423, t6436: note improved ort handling with dirty files Elijah Newren via GitGitGadget
2020-10-23 16:01 ` [PATCH 8/9] t6423: note improved ort handling with untracked files Elijah Newren via GitGitGadget
2020-10-23 16:01 ` Elijah Newren via GitGitGadget [this message]
2020-10-23 20:12 ` [PATCH 9/9] t6423: add more details about direct resolution of directories Elijah Newren
2020-10-26 17:01 ` [PATCH v2 0/9] Support both merge backends in the testsuite, via environment variable Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 1/9] t/: new helper for tests that pass with ort but fail with recursive Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 2/9] merge tests: expect improved directory/file conflict handling in ort Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 3/9] t6416: correct expectation for rename/rename(1to2) + directory/file Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 4/9] t6404, t6423: expect improved rename/delete handling in ort backend Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 5/9] t6423: expect improved conflict markers labels in the " Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 6/9] merge tests: expect slight differences in output for recursive vs. ort Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 7/9] t6423, t6436: note improved ort handling with dirty files Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 8/9] t6423: note improved ort handling with untracked files Elijah Newren via GitGitGadget
2020-10-26 17:01 ` [PATCH v2 9/9] t6423: add more details about direct resolution of directories Elijah Newren via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2659d1cb987735ec123ca7a82ed7e058e4d6bef0.1603468885.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).