Re: [PATCH v2] t/perf/p3400: speed up setup using fast-import
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jan 30, 2026, 06:41 UTC
- Message-ID
- <04005f67-3ec5-4fa7-9fd7-37ef9034286a@kdbg.org>
- In-Reply-To
- <20260128160717.611391-1-a3205153416@gmail.com>
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 &&
Show 7 quoted lines
> + > + ( > + 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