From: shejialuo <shejialuo@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
Karthik Nayak <karthik.188@gmail.com>,
Taylor Blau <me@ttaylorr.com>, Junio C Hamano <gitster@pobox.com>,
Justin Tobler <jltobler@gmail.com>
Subject: Re: [PATCH v2 12/14] refs: don't store peeled object IDs for invalid tags
Date: Thu, 9 Oct 2025 00:27:58 +0800 [thread overview]
Message-ID: <aOaRDhwZ0YkPdjkd@ArchLinux> (raw)
In-Reply-To: <20251008-b4-pks-ref-filter-skip-parsing-objects-v2-12-76e30d5c9542@pks.im>
On Wed, Oct 08, 2025 at 05:50:27PM +0200, Patrick Steinhardt wrote:
> Both the "files" and "reftable" backend store peeled object IDs for
> references that point to tags:
>
> - The "files" backend stores the value when packing refs, where each
> peeled object ID is prefixed with "^".
>
> - The "reftable" backend stores the value whenever writing a new
> reference that points to a tag via a special ref record type.
>
> Both of these backends use `peel_object()` to find the peeled object ID.
> But as explained in the preceding commit, that function does not detect
> the case where the tag's tagged object and its claimed type mismatch.
>
> The consequence of storing these bogus peeled object IDs is that we're
> less likely to detect such corruption in other parts of Git.
> git-for-each-ref(1) for example does not notice anymore that the tag is
> broken when using "--format=%(*objectname)" to dereference tags.
>
> One could claim that this is good, because it still allows us to mostly
> use the tag as intended. But the biggest problem here is that we now
> have different behaviour for such a broken tag depending on whether or
> not we have its peeled value in the refdb.
>
> Fix the issue by verifying the object type when peeling the object. If
> that verification fails we simply skip storing the peeled value in
> either of the reference formats.
>
I have a design question here: should we just report an error to the
user or just die instead of skipping storing the peeled value? If the
annotated tag is corrupted in the first place, it means the refdb is
also corrupted. And "git-fsck(1)" would definitely report an error to
the user. But here we just ignore the problem and give an illusion that
everything is fine.
Thanks,
Jialuo
next prev parent reply other threads:[~2025-10-08 16:27 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-07 10:58 [PATCH 00/13] refs: improvements and fixes for peeling tags Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 01/13] refs: introduce wrapper struct for `each_ref_fn` Patrick Steinhardt
2025-10-07 18:05 ` Justin Tobler
2025-10-08 13:42 ` Patrick Steinhardt
2025-10-07 21:56 ` Taylor Blau
2025-10-08 15:52 ` shejialuo
2025-10-09 6:03 ` Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 02/13] refs: introduce `.ref` field for the base iterator Patrick Steinhardt
2025-10-07 14:24 ` Karthik Nayak
2025-10-08 13:44 ` Patrick Steinhardt
2025-10-08 15:03 ` Patrick Steinhardt
2025-10-07 20:19 ` Justin Tobler
2025-10-07 21:57 ` Taylor Blau
2025-10-07 10:58 ` [PATCH 03/13] refs: refactor reference status flags Patrick Steinhardt
2025-10-07 14:27 ` Karthik Nayak
2025-10-08 13:44 ` Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 04/13] refs: expose peeled object ID via the iterator Patrick Steinhardt
2025-10-07 14:52 ` Karthik Nayak
2025-10-08 13:45 ` Patrick Steinhardt
2025-10-15 8:28 ` Karthik Nayak
2025-10-07 10:58 ` [PATCH 05/13] upload-pack: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-07 16:18 ` Karthik Nayak
2025-10-08 13:45 ` Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 06/13] ref-filter: propagate peeled object ID Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 07/13] builtin/show-ref: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 08/13] refs: drop `current_ref_iter` hack Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 09/13] refs: drop infrastructure to peel via iterators Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 10/13] object: add flag to `peel_object()` to verify object type Patrick Steinhardt
2025-10-08 11:04 ` Kristoffer Haugsbakk
2025-10-07 10:58 ` [PATCH 11/13] refs: don't store peeled object IDs for invalid tags Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 12/13] ref-filter: detect broken tags when dereferencing them Patrick Steinhardt
2025-10-07 10:58 ` [PATCH 13/13] ref-filter: parse objects on demand Patrick Steinhardt
2025-10-08 11:05 ` Kristoffer Haugsbakk
2025-10-08 13:45 ` Patrick Steinhardt
2025-10-07 21:00 ` [PATCH 00/13] refs: improvements and fixes for peeling tags Junio C Hamano
2025-10-07 21:49 ` Taylor Blau
2025-10-07 23:01 ` Junio C Hamano
2025-10-08 15:50 ` [PATCH v2 00/14] " Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 01/14] refs: introduce wrapper struct for `each_ref_fn` Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 02/14] refs: introduce `.ref` field for the base iterator Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 03/14] refs: fully reset `struct ref_iterator::ref` on iteration Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 04/14] refs: refactor reference status flags Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 05/14] refs: expose peeled object ID via the iterator Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 06/14] upload-pack: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 07/14] ref-filter: propagate peeled object ID Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 08/14] builtin/show-ref: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 09/14] refs: drop `current_ref_iter` hack Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 10/14] refs: drop infrastructure to peel via iterators Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 11/14] object: add flag to `peel_object()` to verify object type Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 12/14] refs: don't store peeled object IDs for invalid tags Patrick Steinhardt
2025-10-08 16:27 ` shejialuo [this message]
2025-10-09 5:22 ` Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 13/14] ref-filter: detect broken tags when dereferencing them Patrick Steinhardt
2025-10-08 15:50 ` [PATCH v2 14/14] ref-filter: parse objects on demand Patrick Steinhardt
2025-10-09 5:38 ` [PATCH v2 00/14] refs: improvements and fixes for peeling tags Jeff King
2025-10-09 6:09 ` Patrick Steinhardt
2025-10-09 6:39 ` Jeff King
2025-10-09 7:24 ` Patrick Steinhardt
2025-10-10 5:12 ` Jeff King
2025-10-10 5:22 ` Patrick Steinhardt
2025-10-10 6:26 ` Jeff King
2025-10-10 15:29 ` Junio C Hamano
2025-10-14 6:31 ` Patrick Steinhardt
2025-10-14 16:52 ` Junio C Hamano
2025-10-09 10:11 ` Toon Claes
2025-10-09 19:37 ` Junio C Hamano
2025-10-22 6:41 ` [PATCH v3 " Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 01/14] refs: introduce wrapper struct for `each_ref_fn` Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 02/14] refs: introduce `.ref` field for the base iterator Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 03/14] refs: fully reset `struct ref_iterator::ref` on iteration Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 04/14] refs: refactor reference status flags Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 05/14] refs: expose peeled object ID via the iterator Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 06/14] upload-pack: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 07/14] ref-filter: propagate peeled object ID Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 08/14] builtin/show-ref: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 09/14] refs: drop `current_ref_iter` hack Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 10/14] refs: drop infrastructure to peel via iterators Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 11/14] object: add flag to `peel_object()` to verify object type Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 12/14] refs: don't store peeled object IDs for invalid tags Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 13/14] ref-filter: detect broken tags when dereferencing them Patrick Steinhardt
2025-10-22 6:41 ` [PATCH v3 14/14] ref-filter: parse objects on demand Patrick Steinhardt
2025-10-22 15:27 ` Junio C Hamano
2025-10-23 6:00 ` Patrick Steinhardt
2025-10-22 10:57 ` [PATCH v3 00/14] refs: improvements and fixes for peeling tags Karthik Nayak
2025-10-22 14:47 ` Junio C Hamano
2025-10-23 5:52 ` Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 " Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 01/14] refs: introduce wrapper struct for `each_ref_fn` Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 02/14] refs: introduce `.ref` field for the base iterator Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 03/14] refs: fully reset `struct ref_iterator::ref` on iteration Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 04/14] refs: refactor reference status flags Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 05/14] refs: expose peeled object ID via the iterator Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 06/14] upload-pack: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 07/14] ref-filter: propagate peeled object ID Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 08/14] builtin/show-ref: convert to use `reference_get_peeled_oid()` Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 09/14] refs: drop `current_ref_iter` hack Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 10/14] refs: drop infrastructure to peel via iterators Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 11/14] object: add flag to `peel_object()` to verify object type Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 12/14] refs: don't store peeled object IDs for invalid tags Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 13/14] ref-filter: detect broken tags when dereferencing them Patrick Steinhardt
2025-10-23 7:16 ` [PATCH v4 14/14] ref-filter: parse objects on demand Patrick Steinhardt
2025-11-04 22:07 ` Jeff King
2025-11-04 23:40 ` Junio C Hamano
2025-11-04 23:54 ` Jeff King
2025-10-23 23:06 ` [PATCH v4 00/14] refs: improvements and fixes for peeling tags Junio C Hamano
2025-10-24 5:12 ` Patrick Steinhardt
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=aOaRDhwZ0YkPdjkd@ArchLinux \
--to=shejialuo@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@gmail.com \
--cc=karthik.188@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=me@ttaylorr.com \
--cc=ps@pks.im \
/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;
as well as URLs for NNTP newsgroup(s).