Subject: Re: [PATCH v3 10/12] path-walk: support `tree:0` filter

From: Derrick Stolee <[email-masked]>
Date: Wed, 13 May 2026 15:46:16 -0400

On 5/11/2026 9:41 PM, Taylor Blau wrote:
> On Mon, May 11, 2026 at 06:13:07PM +0000, Taylor Blau via GitGitGadget wrote:
>> @@ -534,6 +545,18 @@ static int setup_pending_objects(struct path_walk_info *info,
>>  			free(tagged_blobs);
>>  		}
>>  	}
>> +	if (tagged_trees) {
>> +		if (tagged_trees->oids.nr) {
>> +			const char *tagged_tree_path = "/tagged-trees";
>> +			tagged_trees->type = OBJ_TREE;
>> +			tagged_trees->maybe_interesting = 1;
>> +			strmap_put(&ctx->paths_to_lists, tagged_tree_path, tagged_trees);
>> +			push_to_stack(ctx, tagged_tree_path);
>> +		} else {
>> +			oid_array_clear(&tagged_trees->oids);
>> +			free(tagged_trees);
>> +		}
>> +	}
>>  	if (tags) {
>>  		if (tags->oids.nr) {
>>  			const char *tag_path = "/tags";
> 
> It looks like there is some prior art here for enumerating a sentinel
> path for "/tags", but I am curious why we did the same for
> directly-listed trees in the presence of --filter=tree:0.

It turns out that this confusion is actually due to some major
flaws in how the path-walk API was treating tagged trees. The
test setup didn't catch this because the tagged trees were also
root trees from commits, so this wasn't caught before.

This means that in the next version, there will be a setup
patch that updates the test setup (and demonstrates the error
that those changes don't impact the rest of the tests) but
the new version of this patch will be substantial.

Thanks,
-Stolee