From: Junio C Hamano <gitster@pobox.com>
To: "Xing Xin" <bupt_xingxin@163.com>
Cc: "blanet via GitGitGadget" <gitgitgadget@gmail.com>,
git@vger.kernel.org, "Xing Xin" <xingxin.xx@bytedance.com>
Subject: Re: [PATCH v2] read-cache: hash the shared index even with index.skipHash
Date: Sat, 05 Dec 2026 14:47:20 +0900 [thread overview]
Message-ID: <xmqq1p7wnus7.fsf@gitster.g> (raw)
In-Reply-To: <47be148e.6b3d.1a22b6cb367.Coremail.bupt_xingxin@163.com> (Xing Xin's message of "Mon, 30 Nov 2026 15:47:53 +0800 (CST)")
"Xing Xin" <bupt_xingxin@163.com> writes:
>> It is also worth checking how concurrent-update detection behaves when
>> both features are active. Suppose a repository has both core.splitIndex
>> and index.skipHash enabled, and "git status" reads the split index and
>> later calls repo_verify_index() before writing back.
>> ...
> Yes. read_index_from() reads .git/index into the index_state itself,
> where do_read_index() records its null trailer in istate->oid and its
> stat data in istate->file_stat, and reads the shared index into the
> separate istate->split_index->base. Nothing touches ...
> ...
>> Likewise, "git fsck" runs read_index_from() with verify_index_checksum
>> set, so verify_hdr() accepts the null trailer on .git/index while
>> verifying the real hash on the shared index file.
>
> Right. do_read_index() calls verify_hdr() for both files, and with
> this patch the shared index always has a real trailer, so "git fsck"
> verifies it: flipping a byte in an entry of the shared index makes it
> fail with "bad index file sha1 signature". The split index, like any
> index written with index.skipHash, has no checksum to verify.
Thanks. Recording some of these things, perhaps in a bit more condensed
form, in the commit log message should help future readers of 'git log'
when they want to find out what thought process brought us to the final
state of the code, I think.
I am still mostly offline, but will be back next week, so please take
your time sending in a (hopefully final) reroll.
prev parent reply other threads:[~2026-12-05 5:47 UTC|newest]
Thread overview: 8+ 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
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
2026-12-05 5:47 ` Junio C Hamano [this message]
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=xmqq1p7wnus7.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.