From: Derrick Stolee Date: Thu, 21 May 2026 22:56:48 GMT Subject: Re: [PATCH v4 03/13] t/perf: add pack-objects filter and path-walk benchmark Message-ID: <2485a7c4-c798-4886-ab64-a22fa70f55be@gmail.com> In-Reply-To: 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 depth2-dirs.raw && >> + sed "s|^|$tdir/|" 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 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