From: "Zach FettersMoore via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Zach FettersMoore <zach.fetters@apollographql.com>,
Zach FettersMoore <zach.fetters@apollographql.com>
Subject: [PATCH v3 3/3] subtree: adding test to validate fix
Date: Fri, 29 Sep 2023 20:33:00 +0000 [thread overview]
Message-ID: <eff8bfcc04278eeae658ffbff8317f822edb9b20.1696019580.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1587.v3.git.1696019580.gitgitgadget@gmail.com>
From: Zach FettersMoore <zach.fetters@apollographql.com>
Adding a test to validate that the proposed fix
solves the issue.
The test accomplishes this by checking the output
of the split command to ensure the output from
the progress of 'process_split_commit' function
that represents the 'extracount' of commits
processed does not increment.
This was tested against the original functionality
to show the test failed, and then with this fix
to show the test passes.
This illustrated that when using multiple subtrees,
A and B, when doing a split on subtree B, the
processing does not traverse the entire history
of subtree A which is unnecessary and would cause
the 'extracount' of processed commits to climb
based on the number of commits in the history of
subtree A.
Signed-off-by: Zach FettersMoore <zach.fetters@apollographql.com>
---
contrib/subtree/t/t7900-subtree.sh | 41 ++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
index 49a21dd7c9c..57c12e9f924 100755
--- a/contrib/subtree/t/t7900-subtree.sh
+++ b/contrib/subtree/t/t7900-subtree.sh
@@ -385,6 +385,47 @@ test_expect_success 'split sub dir/ with --rejoin' '
)
'
+test_expect_success 'split with multiple subtrees' '
+ subtree_test_create_repo "$test_count" &&
+ subtree_test_create_repo "$test_count/subA" &&
+ subtree_test_create_repo "$test_count/subB" &&
+ test_create_commit "$test_count" main1 &&
+ test_create_commit "$test_count/subA" subA1 &&
+ test_create_commit "$test_count/subA" subA2 &&
+ test_create_commit "$test_count/subA" subA3 &&
+ test_create_commit "$test_count/subB" subB1 &&
+ (
+ cd "$test_count" &&
+ git fetch ./subA HEAD &&
+ git subtree add --prefix=subADir FETCH_HEAD
+ ) &&
+ (
+ cd "$test_count" &&
+ git fetch ./subB HEAD &&
+ git subtree add --prefix=subBDir FETCH_HEAD
+ ) &&
+ test_create_commit "$test_count" subADir/main-subA1 &&
+ test_create_commit "$test_count" subBDir/main-subB1 &&
+ (
+ cd "$test_count" &&
+ git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 1"
+ ) &&
+ (
+ cd "$test_count" &&
+ git subtree split --prefix=subBDir --squash --rejoin -m "Sub B Split 1"
+ ) &&
+ test_create_commit "$test_count" subADir/main-subA2 &&
+ test_create_commit "$test_count" subBDir/main-subB2 &&
+ (
+ cd "$test_count" &&
+ git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 2"
+ ) &&
+ (
+ cd "$test_count" &&
+ test "$(git subtree split --prefix=subBDir --squash --rejoin -d -m "Sub B Split 1" 2>&1 | grep -w "\[1\]")" = ""
+ )
+'
+
test_expect_success 'split sub dir/ with --rejoin from scratch' '
subtree_test_create_repo "$test_count" &&
test_create_commit "$test_count" main1 &&
--
gitgitgadget
WARNING: multiple messages have this Message-ID (diff)
From: Zach FettersMoore <zach.fetters@apollographql.com>
To: gitgitgadget@gmail.com, git@vger.kernel.org
Cc: zach.fetters@apollographql.com
Subject: [PATCH v3 3/3] subtree: adding test to validate fix
Date: Tue, 17 Oct 2023 16:02:39 -0400 [thread overview]
Message-ID: <eff8bfcc04278eeae658ffbff8317f822edb9b20.1696019580.git.gitgitgadget@gmail.com> (raw)
Message-ID: <20231017200239.tm27dXOvxfNtNghXqzyYoIZJO1UYFFmI8hM06LoTGrg@z> (raw)
In-Reply-To: <pull.1587.v3.git.1696019580.gitgitgadget@gmail.com>
From: "Zach FettersMoore via GitGitGadget" <gitgitgadget@gmail.com>
> From: Zach FettersMoore <zach.fetters@apollographql.com>
>
> Adding a test to validate that the proposed fix
> solves the issue.
>
> The test accomplishes this by checking the output
> of the split command to ensure the output from
> the progress of 'process_split_commit' function
> that represents the 'extracount' of commits
> processed does not increment.
>
> This was tested against the original functionality
> to show the test failed, and then with this fix
> to show the test passes.
>
> This illustrated that when using multiple subtrees,
> A and B, when doing a split on subtree B, the
> processing does not traverse the entire history
> of subtree A which is unnecessary and would cause
> the 'extracount' of processed commits to climb
> based on the number of commits in the history of
> subtree A.
>
> Signed-off-by: Zach FettersMoore <zach.fetters@apollographql.com>
> ---
> contrib/subtree/t/t7900-subtree.sh | 41 ++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
> index 49a21dd7c9c..57c12e9f924 100755
> --- a/contrib/subtree/t/t7900-subtree.sh
> +++ b/contrib/subtree/t/t7900-subtree.sh
> @@ -385,6 +385,47 @@ test_expect_success 'split sub dir/ with --rejoin' '
> )
> '
>
> +test_expect_success 'split with multiple subtrees' '
> + subtree_test_create_repo "$test_count" &&
> + subtree_test_create_repo "$test_count/subA" &&
> + subtree_test_create_repo "$test_count/subB" &&
> + test_create_commit "$test_count" main1 &&
> + test_create_commit "$test_count/subA" subA1 &&
> + test_create_commit "$test_count/subA" subA2 &&
> + test_create_commit "$test_count/subA" subA3 &&
> + test_create_commit "$test_count/subB" subB1 &&
> + (
> + cd "$test_count" &&
> + git fetch ./subA HEAD &&
> + git subtree add --prefix=subADir FETCH_HEAD
> + ) &&
> + (
> + cd "$test_count" &&
> + git fetch ./subB HEAD &&
> + git subtree add --prefix=subBDir FETCH_HEAD
> + ) &&
> + test_create_commit "$test_count" subADir/main-subA1 &&
> + test_create_commit "$test_count" subBDir/main-subB1 &&
> + (
> + cd "$test_count" &&
> + git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 1"
> + ) &&
> + (
> + cd "$test_count" &&
> + git subtree split --prefix=subBDir --squash --rejoin -m "Sub B Split 1"
> + ) &&
> + test_create_commit "$test_count" subADir/main-subA2 &&
> + test_create_commit "$test_count" subBDir/main-subB2 &&
> + (
> + cd "$test_count" &&
> + git subtree split --prefix=subADir --squash --rejoin -m "Sub A Split 2"
> + ) &&
> + (
> + cd "$test_count" &&
> + test "$(git subtree split --prefix=subBDir --squash --rejoin -d -m "Sub B Split 1" 2>&1 | grep -w "\[1\]")" = ""
> + )
> +'
> +
> test_expect_success 'split sub dir/ with --rejoin from scratch' '
> subtree_test_create_repo "$test_count" &&
> test_create_commit "$test_count" main1 &&
> --
Checking to see if there is something else I need to do with this
to get it across the finish line, wasn't sure if something else
was needed since it's been dormant since my last push a few
weeks ago.
Thanks
next prev parent reply other threads:[~2023-09-29 20:33 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 20:05 [PATCH] subtree: fix split processing with multiple subtrees present Zach FettersMoore via GitGitGadget
2023-09-18 23:31 ` Junio C Hamano
2023-09-19 1:04 ` Junio C Hamano
2023-10-26 19:59 ` Zach FettersMoore
2023-09-22 16:25 ` [PATCH v2 0/2] " Zach FettersMoore via GitGitGadget
2023-09-22 16:25 ` [PATCH v2 1/2] " Zach FettersMoore via GitGitGadget
2023-09-22 16:25 ` [PATCH v2 2/2] subtree: changing location of commit ignore processing Zach FettersMoore via GitGitGadget
2023-09-29 20:32 ` [PATCH v3 0/3] subtree: fix split processing with multiple subtrees present Zach FettersMoore via GitGitGadget
2023-09-29 20:32 ` [PATCH v3 1/3] " Zach FettersMoore via GitGitGadget
2023-09-29 20:32 ` [PATCH v3 2/3] subtree: changing location of commit ignore processing Zach FettersMoore via GitGitGadget
2023-09-29 20:33 ` Zach FettersMoore via GitGitGadget [this message]
2023-10-17 20:02 ` [PATCH v3 3/3] subtree: adding test to validate fix Zach FettersMoore
2023-10-26 19:17 ` [PATCH v4] subtree: fix split processing with multiple subtrees present Zach FettersMoore via GitGitGadget
2023-11-18 11:28 ` Christian Couder
2023-11-28 21:04 ` Zach FettersMoore
2023-11-28 21:17 ` [PATCH v5] " Zach FettersMoore via GitGitGadget
2023-11-30 20:33 ` Christian Couder
2023-11-30 21:01 ` Zach FettersMoore
2023-12-01 14:54 ` [PATCH v6] " Zach FettersMoore via GitGitGadget
2023-12-04 11:08 ` Christian Couder
2023-12-11 15:39 ` Zach FettersMoore
2023-12-12 16:06 ` Christian Couder
2023-12-12 22:28 ` Junio C Hamano
2023-12-13 15:20 ` Zach FettersMoore
2024-01-03 16:33 ` Christian Couder
2023-12-20 15:25 ` Christian Couder
2024-01-25 10:09 ` Christian Couder
2024-01-25 16:38 ` Junio C Hamano
2024-01-25 18:52 ` Christian Couder
2024-01-25 18:56 ` Junio C Hamano
2025-08-21 3:13 ` subtree: [v2.44 regression] split may produce different history Colin Stagner
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=eff8bfcc04278eeae658ffbff8317f822edb9b20.1696019580.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=zach.fetters@apollographql.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).