git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Tian YuchenNext: Johannes Sixt
Message 6 of 14 in “[RFC] t/perf/p3400: speed up setup using fast-import”
  1. [RFC] t/perf/p3400: speed up setup using fast-importTian Yuchen, Jan 26, 2026
  2. Tian YuchenJan 26, 2026
  3. Tian YuchenJan 28, 2026
  4. Tian YuchenJan 28, 2026
  5. t/perf/p3400: speed up setup using fast-importTian Yuchen, Jan 28, 2026
  6. Johannes SixtJan 30, 2026
  7. Johannes SixtJan 30, 2026
  8. Junio C HamanoJan 30, 2026
  9. Phillip WoodJan 30, 2026
  10. Tian YuchenJan 30, 2026
  11. t/perf/p3400: speed up setup using fast-importTian Yuchen, Jan 30, 2026
  12. t/perf/p3400: speed up setup using fast-importTian Yuchen, Jan 30, 2026
  13. Junio C HamanoJan 30, 2026
  14. Johannes SixtJan 30, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.