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

Junio C Hamano <gitster@pobox.com> writes:

> I didn't look into CI failures but spotted an easy one by
> eyeballing.

[snip]

>--- c/contrib/subtree/t/t7900-subtree.sh
>+++ w/contrib/subtree/t/t7900-subtree.sh
>@@ -1597,7 +1597,8 @@ 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") &&
>+
>+	defaultBranch=$(git -C "$test_count" symbolic-ref --short HEAD) &&

The subtree tests set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME, so
this is one alternative.

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.

-- >8 --

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.

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
 	)
-- 
2.43.0


  parent reply	other threads:[~2026-02-04  4:41 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 [this message]
2026-02-04 19:55                 ` Junio C Hamano
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=20260204043812.814884-3-ask+git@howdoi.land \
    --to=ask+git@howdoi.land \
    --cc=adam@dinwoodie.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox