<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch v2.53.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.53.0</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.53.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-01-12T14:55:41Z</updated>
<entry>
<title>refs/reftable: introduce generic checks for refs</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06d6ead762ba525c5837812e7f509406253cdacd'/>
<id>urn:sha1:06d6ead762ba525c5837812e7f509406253cdacd</id>
<content type='text'>
In a preceding commit we have extracted generic checks for both direct
and symbolic refs that apply for all backends. Wire up those checks for
the "reftable" backend.

Note that this is done by iterating through all refs manually with the
low-level reftable ref iterator. We explicitly don't want to use the
higher-level iterator that is exposed to users of the reftable backend
as that iterator may swallow for example broken refs.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/reftable: fix consistency checks with worktrees</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:03:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9341740bea2ce334be412835fdcc0dd31550071a'/>
<id>urn:sha1:9341740bea2ce334be412835fdcc0dd31550071a</id>
<content type='text'>
The ref consistency checks are driven via `cmd_refs_verify()`. That
function loops through all worktrees (including the main worktree) and
then checks the ref store for each of them individually. It follows that
the backend is expected to only verify refs that belong to the specified
worktree.

While the "files" backend handles this correctly, the "reftable" backend
doesn't. In fact, it completely ignores the passed worktree and instead
verifies refs of _all_ worktrees. The consequence is that we'll end up
every ref store N times, where N is the number of worktrees.

Or rather, that would be the case if we actually iterated through the
worktree reftable stacks correctly. But we use `strmap_for_each_entry()`
to iterate through the stacks, but the map is in fact not even properly
populated. So instead of checking stacks N^2 times, we actually only end
up checking the reftable stack of the main worktree.

Fix this bug by only verifying the stack of the passed-in worktree and
constructing the backends via `backend_for_worktree()`.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/reftable: extract function to retrieve backend for worktree</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=78384e2467c4e457f230e731f26409fa7dd72434'/>
<id>urn:sha1:78384e2467c4e457f230e731f26409fa7dd72434</id>
<content type='text'>
Pull out the logic to retrieve a backend for a given worktree. This
function will be used in a subsequent commit.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/reftable: adapt includes to become consistent</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab67f0a43677b56a9cfe3c6b0f1d8fe0f9a988eb'/>
<id>urn:sha1:ab67f0a43677b56a9cfe3c6b0f1d8fe0f9a988eb</id>
<content type='text'>
Adapt the includes to be sorted and to use include paths that are
relative to the "refs/" directory.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: introduce function to perform normal ref checks</title>
<updated>2026-01-12T14:55:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae38c3a359f4834d27f511f1fa9b982f5ad55c6a'/>
<id>urn:sha1:ae38c3a359f4834d27f511f1fa9b982f5ad55c6a</id>
<content type='text'>
In a subsequent commit we'll introduce new generic checks for direct
refs. These checks will be independent of the actual backend.

Introduce a new function `refs_fsck_ref()` that will be used for this
purpose. At the current point in time it's still empty, but it will get
populated in a subsequent commit.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: extract generic symref target checks</title>
<updated>2026-01-12T14:55:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dcecffb616762893c44f98d556493144edbcd498'/>
<id>urn:sha1:dcecffb616762893c44f98d556493144edbcd498</id>
<content type='text'>
The consistency checks for the "files" backend contain a couple of
verifications for symrefs that verify generic properties of the target
reference. These properties need to hold for every backend, no matter
whether it's using the "files" or "reftable" backend.

Reimplementing these checks for every single backend doesn't really make
sense. Extract it into a generic `refs_fsck_symref()` function that can
be used by other backends, as well. The "reftable" backend will be wired
up in a subsequent commit.

While at it, improve the consistency checks so that we don't complain
about refs pointing to a non-ref target in case the target refname
format does not verify. Otherwise it's very likely that we'll generate
both error messages, which feels somewhat redundant in this case.

Note that the function has a couple of `UNUSED` parameters. These will
become referenced in a subsequent commit.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: perform consistency checks for root refs</title>
<updated>2026-01-12T14:55:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b8c36a2a74868b6fa47e3b11e2c1c0f89c88d43'/>
<id>urn:sha1:7b8c36a2a74868b6fa47e3b11e2c1c0f89c88d43</id>
<content type='text'>
While the "files" backend already knows to perform consistency checks
for the "refs/" hierarchy, it doesn't verify any of its root refs. Plug
this omission.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: improve error handling when verifying symrefs</title>
<updated>2026-01-12T14:55:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ebccf744a967f399579a3f3ffbeb40120f5a1e1'/>
<id>urn:sha1:9ebccf744a967f399579a3f3ffbeb40120f5a1e1</id>
<content type='text'>
The error handling when verifying symbolic refs is a bit on the wild
side:

  - `fsck_report_ref()` can be told to ignore specific errors. If an
    error has been ignored and a previous check raised an unignored
    error, then assigning `ret = fsck_report_ref()` will cause us to
    swallow the previous error.

  - When the target reference is not valid we bail out early without
    checking for other errors.

Fix both of these issues by consistently or'ing the return value and not
bailing out early.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: extract function to check single ref</title>
<updated>2026-01-12T14:55:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ff9cf40b2ce3df2f6eda0875eb54fe3c3487f5b'/>
<id>urn:sha1:0ff9cf40b2ce3df2f6eda0875eb54fe3c3487f5b</id>
<content type='text'>
When checking the consistency of references we create a directory
iterator and then verify each single reference in a loop. The logic to
perform the actual checks is embedded into that loop, which makes it
hard to reuse. But In a subsequent commit we're about to introduce a
second path that wants to verify references.

Prepare for this by extracting the logic to check a single reference
into a standalone function.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs/files: remove useless indirection</title>
<updated>2026-01-12T14:55:40Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-12T09:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fe33ae20fcce7a1e91cfeec37409d511ab8aefb'/>
<id>urn:sha1:2fe33ae20fcce7a1e91cfeec37409d511ab8aefb</id>
<content type='text'>
The function `files_fsck_refs()` only has a single callsite and forwards
all of its arguments as-is, so it's basically a useless indirection.
Inline the function call.

While at it, also remove the bitwise or that we have for return values.
We don't really want to or them at all, but rather just want to return
an error in case either of the functions has failed.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
