All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Colin Stagner <ask+git@howdoi.land>
Cc: git@vger.kernel.org,  Patrik Weiskircher <patrik@pspdfkit.com>,
	 Adam Dinwoodie <adam@dinwoodie.org>,
	 Patrick Steinhardt <ps@pks.im>
Subject: Re: Re* [RFH] adding test coverage for contrib/ in CI jobs
Date: Wed, 04 Feb 2026 11:55:17 -0800	[thread overview]
Message-ID: <xmqqms1onv16.fsf@gitster.g> (raw)
In-Reply-To: <20260204043812.814884-3-ask+git@howdoi.land> (Colin Stagner's message of "Tue, 3 Feb 2026 22:38:11 -0600")

Colin Stagner <ask+git@howdoi.land> writes:

> I'll see what I can do about any remaining failures. I'd like to
> improve the test coverage for subtree split. split has a lot of
> complicated logic that needs to be preserved across updates.

Thanks.


> Subject: contrib/subtree: fix tests with reftable backend
>
> One git-subtree test-case relies on git internals to infer the
> default branch name. This test fails with the new reftable
> backend.
>
>     GIT_TEST_DEFAULT_REF_FORMAT=reftable \
>       meson test t7900-subtree
>
> This test script already sets
>
>     GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
>
> which eliminates the need to infer a branch name at runtime.
> Hardcode the branch name.

Makes sense.  

I didn't read the test script carefully enough to be certain that we
were on the initial branch when the defaultBranch computation
happened.

Thanks.  Will replace my hack with this version.

> Signed-off-by: Colin Stagner <ask+git@howdoi.land>
> ---
>  contrib/subtree/t/t7900-subtree.sh | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
> index 316dc5269e..e7040718f2 100755
> --- a/contrib/subtree/t/t7900-subtree.sh
> +++ b/contrib/subtree/t/t7900-subtree.sh
> @@ -1597,7 +1597,6 @@ test_expect_success 'push split to subproj' '
>  
>  test_expect_success 'subtree descendant check' '
>  	subtree_test_create_repo "$test_count" &&
> -	defaultBranch=$(sed "s,ref: refs/heads/,," "$test_count/.git/HEAD") &&
>  	test_create_commit "$test_count" folder_subtree/a &&
>  	(
>  		cd "$test_count" &&
> @@ -1614,7 +1613,7 @@ test_expect_success 'subtree descendant check' '
>  	(
>  		cd "$test_count" &&
>  		git cherry-pick $cherry &&
> -		git checkout $defaultBranch &&
> +		git checkout main &&
>  		git merge -m "merge should be kept on subtree" branch &&
>  		git branch no_subtree_work_branch
>  	) &&
> @@ -1626,10 +1625,10 @@ test_expect_success 'subtree descendant check' '
>  	test_create_commit "$test_count" not_a_subtree_change &&
>  	(
>  		cd "$test_count" &&
> -		git checkout $defaultBranch &&
> +		git checkout main &&
>  		git merge -m "merge should be skipped on subtree" no_subtree_work_branch &&
>  
> -		git subtree split --prefix folder_subtree/ --branch subtree_tip $defaultBranch &&
> +		git subtree split --prefix folder_subtree/ --branch subtree_tip main &&
>  		git subtree split --prefix folder_subtree/ --branch subtree_branch branch &&
>  		test $(git rev-list --count subtree_tip..subtree_branch) = 0
>  	)

  reply	other threads:[~2026-02-04 19:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 12:09 [PATCH] subtree: validate --prefix against commit in split Pushkar Singh
2026-01-15 12:24 ` [PATCH v2] " Pushkar Singh
2026-01-15 16:30   ` Junio C Hamano
2026-01-15 17:52     ` [PATCH v3] " Pushkar Singh
2026-02-02 18:54       ` Josh Steadmon
2026-02-02 19:10         ` Junio C Hamano
2026-02-02 21:07         ` Junio C Hamano
2026-02-03 15:30           ` [RFH] adding test coverage for contrib/ in CI jobs Junio C Hamano
2026-02-03 17:06             ` Re* " Junio C Hamano
2026-02-03 23:09               ` Junio C Hamano
2026-02-04  4:38               ` Colin Stagner
2026-02-04 19:55                 ` Junio C Hamano [this message]
2026-02-05  6:05               ` Colin Stagner
2026-02-05 16:39                 ` Junio C Hamano
2026-02-05 20:54                   ` Junio C Hamano
2026-02-03 21:26             ` Junio C Hamano
2026-02-03 21:53               ` Jeff King
2026-02-03 16:48       ` [PATCH v4] subtree: validate --prefix against commit in split Pushkar Singh
2026-02-03 17:37         ` Junio C Hamano

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=xmqqms1onv16.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=adam@dinwoodie.org \
    --cc=ask+git@howdoi.land \
    --cc=git@vger.kernel.org \
    --cc=patrik@pspdfkit.com \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.