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 26, 2026, 19:21 UTC
Message-ID
<xmqqld6fjt55.fsf@gitster.g>
In-Reply-To
<pull.2337.git.1795701443098.gitgitgadget@gmail.com>
"blanet via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 14 quoted lines
> From: Xing Xin <xingxin.xx@bytedance.com>
>
> The shared index of a split index is named after its trailing hash,
> which the split index records in its "link" extension to find it.
> Since ee1f0c242e (read-cache: add index.skipHash config option,
> 2023-01-06), do_write_index() skips that hash for the shared index
> too, so with index.skipHash and core.splitIndex both set, the shared
> index is written as "sharedindex.<null OID>" and the split index
> records a null OID as its base. Reading the index back, a null base
> means there is no shared index: the entries that were moved there are
> lost, "git ls-files" no longer shows them and "git status" reports
> them as deleted and untracked. With fsmonitor, it hits a BUG() in
> fsmonitor.c instead, as the fsmonitor bitmap refers to more entries
> than the index has.

It is correct to point out that the two "features", skipHash and splitIndex, are incompatible. With skipHash, splitIndex will not correctly work. We can say skipHash breaks splitIndex.

But does this change to _force_ the base index files to be hashed, against the user's wish expressed by skipHash, take us in a better direction, I have to wonder? With this change, skipHash's promise to improve performance is not kept. We can say splitIndex breaks skipHash.

Stepping back a bit, isn't the expectation of splitIndex that these incremental modifications held in non-base index files are relatively small, thanks to the bulk of data that the base index file holds covering almost everything in the repository? In other words, isn't the use of splitIndex a strong sign that the base index file would benefit 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.

I wonder if going in the other direction, i.e., when both are enabled, disabling splitIndex and working only on the base hash, would be an alternative that is equally viable as this change? Both will *break* the promise of one feature so that the result can live with the other feature. What are the pros and cons between them?

Previous: blanet via GitGitGadgetNext: Xing Xin
Message 2 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.