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

Re: [PATCH] read-cache: hash the shared index even with index.skipHash

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 27, 2026, 18:44 UTC
Message-ID
<xmqqwlpy8681.fsf@gitster.g>
In-Reply-To
<5dfa732c.94b8.1a21d16a974.Coremail.bupt_xingxin@163.com>
"Xing Xin" <bupt_xingxin@163.com> writes:
Show 10 quoted lines
>> the most from skipHash?  And this patch is breaking the skipHash feature
>> for the use case that would benefit the most.  And not hashing the index
>> files that are not bases would not save as much, since they are expected
>> to be much smaller.
>
> Per write, yes.  But what skipHash saves is the hashing done on each
> write, and the shared index is only written when it is rewritten,
> which the split index is designed to make rare.  The frequent writes
> are of the small split index, where, as you say, there is little to
> save.

That is a very good justification to give in the proposed commit log message and also in the documentation (the behaviour may already be documented in this initial version of the patch, but the reason why the base index ignores the skipHash configuration deserves a mention, too).

Show 12 quoted lines
>  - index.skipHash is only ever a configuration variable: it is either
>    implied by feature.manyFiles, or set as index.skipHash, by the user
>    or by Scalar, which writes index.skipHash=true into the repository
>    configuration and resets it on "scalar reconfigure".
>
>  - The split index is enabled by core.splitIndex, which neither a
>    feature.* setting nor Scalar sets, or by "git update-index
>    --split-index", which stays in effect while core.splitIndex is
>    unset.
>
> When both are set in the configuration, there is no telling which one
> the user cares about more.

Isn't that mostly a defect of Scalar? Such a tool that configures the repository without close supervision by the user should be responsible for ensuring that the resulting set of configuration variables gives a coherent story of what the user wants.

But by going the route of your patch, we no longer have to worry about these two features conflicting, so I would say it is a good direction to go.

Thanks.
Previous: Xing XinNext: blanet via GitGitGadget
Message 4 of 7 in “read-cache: hash the shared index even with index.skipHash”
  1. read-cache: hash the shared index even with index.skipHashblanet via GitGitGadget, Nov 26, 2026
  2. Junio C HamanoNov 26, 2026
  3. Xing XinNov 27, 2026
  4. Junio C HamanoNov 27, 2026
  5. read-cache: hash the shared index even with index.skipHashblanet via GitGitGadget, Nov 28, 2026
  6. Junio C HamanoNov 28, 2026
  7. Xing XinNov 30, 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.