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

Re: [PATCH 1/1] files-backend: check symref name before update

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 2, 2025, 17:34 UTC
Message-ID
<xmqqseg1w6ki.fsf@gitster.g>
In-Reply-To
<aN6amIG2Sp3W500K@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 12 quoted lines
>> ...  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?), ...
>
> We have the same pattern in other command:
>
>     - git commit-graph verify
>     - git multi-pack-index verify
>     - git bundle verify
>
> So `git refs verify` is following the same direction.
Well, bundle falls into a searate category, though.

A bundle file is a thing on its own and wants to be independently verifiable. A packfile (.pack alone without .idx) is also a thing that may want to be independently verifiable. For that they need to be accessible by end-users in a form of some command.

But everything else, ...
> 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.

... including refs, commit-graphs, multi-pack-index do not have life on their own outside the repository they originate in, so there is no reason to expose them as separate commands to end-users.

I do agree that having a separate entry point for exercising them and them alone would help debugging and development, but such an entry point does not have to be a separate binary. It could have been "git fsck --refs-only" instead, for example.

Previous: Patrick SteinhardtNext: shejialuo
Message 8 of 11 in “files-backend: check symref name before update”
  1. 0/1 files-backend: check symref name before updateHan Young, Oct 1, 2025
  2. 1/1 files-backend: check symref name before updateHan Young, Oct 1, 2025
  3. Junio C HamanoOct 1, 2025
  4. Karthik NayakOct 2, 2025
  5. Patrick SteinhardtOct 2, 2025
  6. Junio C HamanoOct 2, 2025
  7. Patrick SteinhardtOct 2, 2025
  8. Junio C HamanoOct 2, 2025
  9. shejialuoOct 5, 2025
  10. Karthik NayakOct 2, 2025
  11. Junio C HamanoOct 2, 2025

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.