git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ref-filter: fix stale parsed objects

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 4, 2025, 18:31 UTC
Message-ID
<xmqqpl9xps3x.fsf@gitster.g>
In-Reply-To
<20251104-b4-pks-ref-filter-fixup-v1-1-2fbca52d76d9@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 29 quoted lines
> In 054f5f457e (ref-filter: parse objects on demand, 2025-10-23) we have
> started to skip parsing some objects in case we don't need to access
> their values in the first place. This was done by introducing a new
> member `struct expand_data::maybe_object` that gets populated on demand
> via `get_or_parse_object()`.
>
> This has led to a regression though where the object now gets reused
> because we don't reset it properly. The `oi` structure is declared in
> global scope, and there is no single place where we reset it before
> invoking `get_object()`. The consequence is that the `maybe_object`
> member doesn't get reset across calls, so subsequent calls will end up
> reusing the same object.
>
> This is only an issue for a subset of retrieved values, as not all of
> the infrastructure ends up calling `get_or_parse_object()`. So the
> effect is limited, which is probably why the issue wasn't detected
> earlier.
>
> Fix the issue by resetting `maybe_object` in `get_object()`.
>
> Reported-by: Junio C Hamano <gitster@pobox.com>
> Based-on-patch-by: Jeff King <peff@peff.net>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
> As reported by Junio in <xmqqo6pjt2wn.fsf@gitster.g>. This applies
> directly on top of ps/ref-peeled-tags at 054f5f457e (ref-filter: parse
> objects on demand, 2025-10-23)
>
> Thanks!

Thanks. As we stop reusing a stale maybe_object and instead start parsing the right object when we need to, I wondered if the "on demand" commit needs a new benchmark, but the example cited in the message used %(raw) so it would not be affected, I guess.

Queued.  Thanks.
Previous: Junio C HamanoNext: Jeff King
Message 3 of 7 in “ref-filter: fix stale parsed objects”
  1. ref-filter: fix stale parsed objectsPatrick Steinhardt, Nov 4, 2025
  2. Junio C HamanoNov 4, 2025
  3. Junio C HamanoNov 4, 2025
  4. Jeff KingNov 4, 2025
  5. Jeff KingNov 4, 2025
  6. Patrick SteinhardtNov 6, 2025
  7. Jeff KingNov 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.