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