Git development
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Elijah Newren <newren@gmail.com>
Subject: Re: [RFC PATCH 3/7] path-walk: support `object:type` filter
Date: Mon, 4 May 2026 08:32:48 -0400	[thread overview]
Message-ID: <f8a376a2-33dc-4e9a-9365-ae453c1452c5@gmail.com> (raw)
In-Reply-To: <db46c1248ece57476b369a9bff920facab24be04.1777853408.git.me@ttaylorr.com>

On 5/3/2026 8:11 PM, Taylor Blau wrote:
> The `object:type` filter accepts only objects of a single type; it is
> the second member of the object-info-only filter family that bitmap
> traversal already supports.

...

> But there are a couple of side effects of the "trees off, blobs on" case
> that need fixing:
> 
>  1. 'setup_pending_objects()' previously skipped pending trees as soon
>     as `info->trees` was zero. For 'object:type=blob' the call site
>     needs those pending trees: a lightweight tag pointing to a tree, or
>     an annotated tag whose peeled target is a tree, can both reach
>     blobs that are otherwise unreachable from any commit's root tree.
>     Loosen the gate to "if (!info->trees && !info->blobs) continue" and
>     similarly retrieve the root_tree_list whenever either trees or
>     blobs are wanted.
> 
>  2. The revision machinery's `handle_commit()` drops pending trees when
>     `revs->tree_objects` is zero (see the 'OBJ_TREE' handler in
>     revision.c), so by the time path-walk sees the pending list
>     after `prepare_revision_walk()` the tree-bearing pendings would
>     already be gone. Fix this by setting
> 
>         revs->tree_objects = info->trees || info->blobs
> 
>     so pending trees survive `prepare_revision_walk()` whenever we
>     need to walk into them. Path-walk still resets tree_objects to
>     zero immediately after `prepare_revision_walk()` returns, so the
>     rev-walk itself never enumerates trees redundantly with
>     path-walk's own descent.

Both of these changes are very valuable bug fixes for the path-walk API!
Thanks for catching the distinction here where we should still be
walking trees in order to find the blobs we want.

Thanks,
-Stolee


  reply	other threads:[~2026-05-04 12:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04  0:11 [RFC PATCH 0/7] pack-bitmap: resolve various `--path-walk` incompatibilities Taylor Blau
2026-05-04  0:11 ` [RFC PATCH 1/7] pack-objects: update `--path-walk`'s existing incompatibilities Taylor Blau
2026-05-04 12:22   ` Derrick Stolee
2026-05-04  0:11 ` [RFC PATCH 2/7] path-walk: support `tree:0` filter Taylor Blau
2026-05-04 12:30   ` Derrick Stolee
2026-05-04 21:55   ` Kristoffer Haugsbakk
2026-05-04  0:11 ` [RFC PATCH 3/7] path-walk: support `object:type` filter Taylor Blau
2026-05-04 12:32   ` Derrick Stolee [this message]
2026-05-04  0:11 ` [RFC PATCH 4/7] path-walk: support `combine` filter Taylor Blau
2026-05-04  0:11 ` [RFC PATCH 5/7] pack-objects: support reachability bitmaps with `--path-walk` Taylor Blau
2026-05-04  0:11 ` [RFC PATCH 6/7] pack-objects: extract `record_tree_depth()` helper Taylor Blau
2026-05-04  0:11 ` [RFC PATCH 7/7] pack-objects: support `--delta-islands` with `--path-walk` Taylor Blau
2026-05-04 12:13 ` [RFC PATCH 0/7] pack-bitmap: resolve various `--path-walk` incompatibilities Derrick Stolee

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=f8a376a2-33dc-4e9a-9365-ae453c1452c5@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    /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