From: Junio C Hamano <gitster@pobox.com>
To: Harald Nordgren <haraldnordgren@gmail.com>
Cc: gitgitgadget@gmail.com, git@vger.kernel.org,
karthik.188@gmail.com, mail2venkat21@gmail.com, ps@pks.im
Subject: Re: [PATCH] refs: fix loose-ref seeking across directory boundaries
Date: Thu, 15 Oct 2026 12:13:13 -0700 [thread overview]
Message-ID: <xmqqse26n5fa.fsf@gitster.g> (raw)
In-Reply-To: <20261015133624.82112-1-haraldnordgren@gmail.com> (Harald Nordgren's message of "Thu, 15 Oct 2026 15:36:23 +0200")
Harald Nordgren <haraldnordgren@gmail.com> writes:
> The general idea looks sound.
>
>> + if test "$storage" = mixed
>> + then
>> + git pack-refs --all || return 1
>> + fi &&
>
> I don't see any reason why a test would need an if block, we know what data we
> expect, no?
This is three tests implemented as a single test with a for-loop
around it. The variable instructs the single test_expect_success
to behave slightly differently depending on its setting.
+for storage in loose packed mixed
+do
+ test_expect_success "start after respects directory boundaries ($storage)" '
+ test_when_finished "rm -rf repo" &&
+ git init repo &&
+ (
+ cd repo &&
+ test_commit --no-tag base &&
+ git update-ref refs/tags/packed HEAD &&
+ if test "$storage" = mixed
+ then
+ git pack-refs --all || return 1
+ fi &&
+ git update-ref --stdin <<-\EOF &&
+ create refs/tags/a-leaf HEAD
+ ...
+ EOF
+ if test "$storage" = packed
+ then
+ git pack-refs --all || return 1
+ fi &&
+ ... real test in the repository begins ...
+ )
+ '
+done
It creates a tag "packed", and packs when storage is "mixed". Then
we create many other refs, and packs the whole refs when storage is
"packed". So during these three runs of the for-loop, the preparation
part quoted above behaves this way:
storage=loose no 'git pack-refs' run and every ref is loose
storage=packed the later 'git pack-refs' packs everything
storage=mixed 'packed' tag is packed, everything else is loose
and the test checks what happens in this repository with refs packed
in three different ways.
next prev parent reply other threads:[~2026-10-15 19:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 12:30 [PATCH] refs: fix loose-ref seeking across directory boundaries Venkat Ragavan via GitGitGadget
2026-10-15 13:36 ` Harald Nordgren
2026-10-15 17:08 ` D. Ben Knoble
[not found] ` <CAFuK-oaFyp7QdA=Nrc68cNx1iu803pQSUOZ=f947rRjWbJ7Z5w@mail.gmail.com>
2026-10-15 19:04 ` D. Ben Knoble
2026-10-15 19:13 ` Junio C Hamano [this message]
2026-10-15 21:17 ` Harald Nordgren
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=xmqqse26n5fa.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@gmail.com \
--cc=karthik.188@gmail.com \
--cc=mail2venkat21@gmail.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.