Re: [PATCH v3 00/14] refs: improvements and fixes for peeling tags
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 22, 2025, 10:57 UTC
- Message-ID
- <CAOLa=ZTo0pbPDxrHoTgcOoyAiuN+AYgrACti6kga25+trQnXtw@mail.gmail.com>
- In-Reply-To
- <20251022-b4-pks-ref-filter-skip-parsing-objects-v3-0-eb9f71985ef0@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 47 quoted lines
> Hi, > > originally, all I wanted to do was the last patch: a small performance > optimization that stops parsing objects in git-for-each-ref(1) unless we > really need to parse them. But that fix cause one specific test to fail, > and only with the reftable backend. So this led me down the rabbit hole > of tag peeling, ending up with this patch series. > > The series is structured like follows: > > - Patches 1 to 8 refactor our codebase so that we don't have the > `peel_iterated_object()` hack anymore. I just found it hard to > follow and thought it shouldn't be too hard to get rid of it. > > - Patches 9 and 10 remove infrastructure that we don't need anymore > after the first couple of patches. > > - Patches 11 to 13 fix a couple of issues with peeled tags that I > found. The underlying issue is that tags store both the tagged > object and their type, but this information may not match. We never > verify the actual object type though when allocating the tagged > object, so this only blows up much later. > > - Patch 14 was my original motivation, a small performance > optimization. > > I'm not particularly fond of the patches 11 to 13. It feels more like > playing whack-a-mole, and I very much assume that there still are edge > cases where we should properly verify the tagged object type. But > changing it in `parse_tag_buffer()` itself causes a bunch of tests to > fail where we intentionally create such corrupted tags. So I didn't > really dare to touch that part, to be honest. > > If anybody has suggestions for an alternative approach I'd be very open > to it. > > Changes in v3: > - I've rebuilt the topic on 133d151831 (The twenty-first batch, 2025-10-20) with > - tb/incremental-midx-part-3.1 at 935ab44a0a (builtin/repack.c: > clean up unused `#include`s, 2025-10-15) > - jt/16a93c03c7 at (builtin/repo: add progress meter for > structure stats, 2025-10-21) > merged into it. This is done to fix a couple of merge conflicts with > "seen". Both of the topics are only in "seen" right now, but they > are close to be merged. > - Link to v2: https://lore.kernel.org/r/20251008-b4-pks-ref-filter-skip-parsing-objects-v2-0-76e30d5c9542@pks.im >
I had already reviewed version 1, the changes from v2 and v3 look good to me! :)
Karthik