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

Re: [RFC PATCH 2/7] path-walk: support `tree:0` filter

From
Derrick Stolee <stolee@gmail.com>
Date
May 4, 2026, 12:30 UTC
Message-ID
<bfb6d757-7b13-4267-9fd5-8739c7395378@gmail.com>
In-Reply-To
<e1b7fd3cb2a2bba5f6404ac5f8ac3487a46d51b5.1777853408.git.me@ttaylorr.com>
On 5/3/2026 8:11 PM, Taylor Blau wrote:
Show 5 quoted lines
> The `tree:0` object filter omits all trees and blobs from the result,
> keeping only commits and tags. Consequently, this filter type should
> has a fairly straightforward integration with path-walk, as the decision
> to include an object depends only on its type and does not depend on any
> path-sensitive state.

I agree that the implementation here is straight-forward. It's something where I could easily see wanting to disable the path-walk API because it is no longer contributing much value, but perhaps the caller wants a consistent callback that provides all commits and tags in different chunks.

Show 6 quoted lines
> Non-zero tree-depth filters are not supported. Those depend on the depth
> at which a tree is visited, which is a path-walk concept the filter
> machinery doesn't currently share with the path-walk API. Reject them in
> `prepare_filters()` with a helpful error and let pack-objects fall back
> to the regular traversal, the same way it already does for unsupported
> filters.

I think that this could be remedied with some tweaks to the internal methods and data within the path-walk API to track a depth. This could be handled later, if there was enough demand for nonzero tree-depth.

The diff itself looks good.

Thanks, -Stolee

Previous: Taylor BlauNext: Kristoffer Haugsbakk
Message 5 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.