git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re* [RFH] adding test coverage for contrib/ in CI jobs

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2026, 17:06 UTC
Message-ID
<xmqqjywtu58j.fsf_-_@gitster.g>
In-Reply-To
<xmqqsebhu9nn.fsf_-_@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Unfortunately, this seems to reveal existing other problems with
> subtree tests (t7900), in addition to diff-highlight tests (t9400)
> in various configurations.
>
>   https://github.com/git/git/actions/runs/21617099884
>
> This Ci run is near the tip of 'seen', so there may be breakages
> attributable to new topics in flight, but I suspect that many of
> them are already in 'master', noticed by nobody because nobody ran
> these tests in these configurations (like "breaking changes",
> "sha256", "leaks", "reftable", "asan").
>
> I didn't look into the details of any of these (yet).

I didn't look into CI failures but spotted an easy one by eyeballing. As we seem to be lacking a dedicated subsystem maintainer for this tool, I am CCing those who have touched this test file during the past 24 months, plus our resident reftable expert.

----- >8 -----
Subject: subtree: allow testing with reftable backend

"git subtree" (in contrib/) comes with its own test script, which has this line

    defaultBranch=$(sed "s,ref: refs/heads/,," "$test_count/.git/HEAD")

that assumes that you can read from .git/HEAD as a regular text file and you'd find a textual symref in reffiles backend.

Not necessarily.
    make && cd contrib/subtree && 
    GIT_TEST_DEFAULT_REF_FORMAT=reftable make test

fails due to this. Use "git symbolic-ref" instead to read the value of the symref.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/subtree/t/t7900-subtree.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git c/contrib/subtree/t/t7900-subtree.sh w/contrib/subtree/t/t7900-subtree.sh
index 316dc5269e..344956e72e 100755
--- 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) &&
 	test_create_commit "$test_count" folder_subtree/a &&
 	(
 		cd "$test_count" &&
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 19 in “subtree: validate --prefix against commit in split”
  1. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  2. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  3. Junio C HamanoJan 15, 2026
  4. subtree: validate --prefix against commit in splitPushkar Singh, Jan 15, 2026
  5. Josh SteadmonFeb 2, 2026
  6. Junio C HamanoFeb 2, 2026
  7. Junio C HamanoFeb 2, 2026
  8. [RFH] adding test coverage for contrib/ in CI jobsJunio C Hamano, Feb 3, 2026
  9. Re* [RFH] adding test coverage for contrib/ in CI jobsJunio C Hamano, Feb 3, 2026
  10. Junio C HamanoFeb 3, 2026
  11. Re* [RFH] adding test coverage for contrib/ in CI jobsColin Stagner, Feb 4, 2026
  12. Junio C HamanoFeb 4, 2026
  13. Colin StagnerFeb 5, 2026
  14. Junio C HamanoFeb 5, 2026
  15. Junio C HamanoFeb 5, 2026
  16. Junio C HamanoFeb 3, 2026
  17. Jeff KingFeb 3, 2026
  18. subtree: validate --prefix against commit in splitPushkar Singh, Feb 3, 2026
  19. Junio C HamanoFeb 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.