Re: [PATCH 1/1] files-backend: check symref name before update
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 2, 2025, 15:30 UTC
- Message-ID
- <aN6amIG2Sp3W500K@pks.im>
- In-Reply-To
- <xmqqo6qpxw6w.fsf@gitster.g>
On Thu, Oct 02, 2025 at 06:36:07AM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > Agreed! Overall, the goal is that all logic to verify references should > > be contained in `git refs verify`, so that git-fsck(1) only needs to > > shell out to that command to perform the full check. > > > > So if this logic isn't yet part of `git refs verify`, we should migrate > > it over. > > Absolutely. As "git refs verify" is a way to do the sanity check of > the ref part (presumably without incurring cost to sanity check > other aspect, like fsck does? why is it a separate command in the > first place?), it should learn how to do so.
We have the same pattern in other command:
- git commit-graph verify
- git multi-pack-index verify
- git bundle verifySo `git refs verify` is following the same direction.
I think it's a nice pattern to have this encapsulated functionality so that it's easy to exercise certain subsystems in isolation. git-fsck(1) then becomes a thin wrapper around these commands and is the one that ties it all together, if desired.
> "git fsck" should keep complaining about the failure as before, > whether it is done natively or by delegating to "git refs verify".
Yup.
Patrick