From: Junio C Hamano Date: Thu, 26 Nov 2026 19:21:26 GMT Subject: Re: [PATCH] read-cache: hash the shared index even with index.skipHash Message-ID: In-Reply-To: "blanet via GitGitGadget" writes: > From: Xing Xin > > 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." 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?