Subject: Re: [PATCH v2] t/perf/p3400: speed up setup using fast-import

From: Johannes Sixt <[email-masked]>
Date: Fri, 30 Jan 2026 07:41:34 +0100

Am 28.01.26 um 17:07 schrieb Tian Yuchen:
> +	test_seq 1000 >content_fwd &&
> +	test_seq 1000 | sort -nr >content_rev &&

Remove another pipe with

	sort -nr content_fwd >content_rev &&

> +
> +	(
> +		for i in $(test_seq 100)
> +		do
> +			...
> +			cat content_rev &&
> +			echo "EOF" || return 1

This is an incorrect use of `return` outside a function. This must be
`|| exit 1` (or just `|| exit`) to actually break out of the loop.

Of course, the error code is ignored, because it is in the upstream of a
pipe, so in order to fail the complete command, it would be necessary
that the original error left an incorrect fast-import stream such that
the down-stream `git fast-import` fails. Otherwise, the entire command
can complete successfully in an unexpected way.

Maybe instead of a pipe, dump the stream into a temporary file, so that
the loop's exit code can be captured?

> +		done
> +	) | git fast-import &&
-- Hannes