refs: improvements and fixes for peeling tags
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 7 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 8 and 9 remove infrastructure that we don't need anymore after the first couple of patches.
-
Patches 10 to 12 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 13 was my original motivation, a small performance optimization.
I'm not particularly fond of the patches 10 to 12. 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.
Thanks!
Patrick
--- b4-submit-tracking ---
This section is used internally by b4 prep for tracking purposes.
{ "series": { "revision": 1, "change-id": "20250918-b4-pks-ref-filter-skip-parsing-objects-f0d1f6af4a9f", "prefixes": [] } }
Closes git for-each-ref --format= slower than piping t... (#579 - closed).