Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "blanet via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  blanet <bupt_xingxin@163.com>,
	 Xing Xin <xingxin.xx@bytedance.com>
Subject: Re: [PATCH] read-cache: hash the shared index even with index.skipHash
Date: Thu, 26 Nov 2026 11:21:26 -0800	[thread overview]
Message-ID: <xmqqld6fjt55.fsf@gitster.g> (raw)
In-Reply-To: <pull.2337.git.1795701443098.gitgitgadget@gmail.com> (blanet via GitGitGadget's message of "Thu, 26 Nov 2026 13:57:23 +0000")

"blanet via GitGitGadget" <gitgitgadget@gmail.com> writes:

> 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?


  reply	other threads:[~2026-11-26 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 13:57 [PATCH] read-cache: hash the shared index even with index.skipHash blanet via GitGitGadget
2026-11-26 19:21 ` Junio C Hamano [this message]
2026-11-27 12:59   ` Xing Xin
2026-11-27 18:44     ` Junio C Hamano
2026-11-28  9:27 ` [PATCH v2] " blanet via GitGitGadget
2026-11-28 21:41   ` Junio C Hamano
2026-11-30  7:47     ` Xing Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqld6fjt55.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bupt_xingxin@163.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=xingxin.xx@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox