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, 09:55 UTC
Message-ID
<edc47d68-7e34-49af-b719-cef3076f6eeb@kdbg.org>
In-Reply-To
<04005f67-3ec5-4fa7-9fd7-37ef9034286a@kdbg.org>
Am 30.01.26 um 07:41 schrieb Johannes Sixt:
Show 11 quoted lines
> Am 28.01.26 um 17:07 schrieb Tian Yuchen:
>> +
>> +	(
>> +		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.

I am wrong here, because my earlier tests were too narrow. This use of `return` actually does work as intended, because it happens inside a function. Neither the subshell nor being in the upstream of a pipe negates this fact.

The rest of the comment still stands, though.
Show 11 quoted lines
> 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: Johannes SixtNext: Junio C Hamano
Message 7 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.