Subject: Re: [PATCH v4 03/13] t/perf: add pack-objects filter and path-walk benchmark

From: Derrick Stolee <[email-masked]>
Date: Thu, 21 May 2026 18:56:48 -0400

On 5/19/26 7:51 PM, Taylor Blau wrote:
> On Wed, May 13, 2026 at 09:18:45PM +0000, Derrick Stolee via GitGitGadget wrote:
>> +	>depth2-dirs &&
>> +	while read tdir
>> +	do
>> +		git ls-tree -d --name-only "HEAD:$tdir" 2>/dev/null || return 1
>> +	done <top-dirs >depth2-dirs.raw &&
>> +	sed "s|^|$tdir/|" <depth2-dirs.raw >depth2-dirs &&
> 
> Ugh, I think that this was a bad suggestion on my part, since $tdir
> should be empty at this point.
> 
> Could we use --format here like so?

The --format option is clean. The full loop will look like this:

	while read tdir
	do
		git ls-tree -d --format="$tdir/%(path)" "HEAD:$tdir" || return 1
	done <top-dirs >depth2-dirs &&

> I guess that breaks if $tdir contains a formatting atom, so perhaps we
> should keep the spirit of the original (but using an intermediary file
> instead of piping the output of Git to another command).

Thanks,
-Stolee