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

Re: [RFC PATCH 3/7] path-walk: support `object:type` filter

From
Derrick Stolee <stolee@gmail.com>
Date
May 4, 2026, 12:32 UTC
Message-ID
<f8a376a2-33dc-4e9a-9365-ae453c1452c5@gmail.com>
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.
...
Show 25 quoted lines
> 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

Previous: Taylor BlauNext: Taylor Blau
Message 8 of 13 in “pack-bitmap: resolve various `--path-walk` incompatibilities”
  1. 0/7 pack-bitmap: resolve various `--path-walk` incompatibilitiesTaylor Blau, May 4, 2026
  2. 1/7 pack-objects: update `--path-walk`'s existing incompatibilitiesTaylor Blau, May 4, 2026
  3. Derrick StoleeMay 4, 2026
  4. 2/7 path-walk: support `tree:0` filterTaylor Blau, May 4, 2026
  5. Derrick StoleeMay 4, 2026
  6. Kristoffer HaugsbakkMay 4, 2026
  7. 3/7 path-walk: support `object:type` filterTaylor Blau, May 4, 2026
  8. Derrick StoleeMay 4, 2026
  9. 4/7 path-walk: support `combine` filterTaylor Blau, May 4, 2026
  10. 5/7 pack-objects: support reachability bitmaps with `--path-walk`Taylor Blau, May 4, 2026
  11. 6/7 pack-objects: extract `record_tree_depth()` helperTaylor Blau, May 4, 2026
  12. 7/7 pack-objects: support `--delta-islands` with `--path-walk`Taylor Blau, May 4, 2026
  13. Derrick StoleeMay 4, 2026

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.