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

Re: [PATCH] t9350: redirect input to only fast-import

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 26, 2025, 13:45 UTC
Message-ID
<xmqqpldn12xd.fsf@gitster.g>
In-Reply-To
<20250725160536.2909011-1-christian.couder@gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 39 quoted lines
> A number of tests in "t9350-fast-export.sh" are using sub-shells to
> redirect content to a number of commands instead of only
> `git fast-import`.
>
> This is confusing and possibly error-prone, so let's change those tests
> so that no sub-shell is used and the content goes only to
> `git fast-import`.
>
> Reported-by: Elijah Newren <newren@gmail.com>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>
> This addresses some leftover work discussed in:
>
> https://lore.kernel.org/git/CABPp-BHM5afgiUf7GsTPWmrf_tm6mWnvHWMKiZPxApJzN-U8gg@mail.gmail.com/
>
>
> t/t9350-fast-export.sh | 215 +++++++++++++++++------------------------
>  1 file changed, 91 insertions(+), 124 deletions(-)
>
> diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
> index 46700dbc40..8f85c69d62 100755
> --- a/t/t9350-fast-export.sh
> +++ b/t/t9350-fast-export.sh
> @@ -48,12 +48,11 @@ test_expect_success 'fast-export | fast-import' '
>  	mkdir new &&
>  	git --git-dir=new/.git init &&
>  	git fast-export --all >actual &&
> -	(cd new &&
> -	 git fast-import &&
> -	 test $MAIN = $(git rev-parse --verify refs/heads/main) &&
> -	 test $REIN = $(git rev-parse --verify refs/tags/rein) &&
> -	 test $WER = $(git rev-parse --verify refs/heads/wer) &&
> -	 test $MUSS = $(git rev-parse --verify refs/tags/muss)) <actual
> +	git -C new fast-import <actual &&
> +	test $MAIN = $(git -C new rev-parse --verify refs/heads/main) &&
> +	test $REIN = $(git -C new rev-parse --verify refs/tags/rein) &&
> +	test $WER = $(git -C new rev-parse --verify refs/heads/wer) &&
> +	test $MUSS = $(git -C new rev-parse --verify refs/tags/muss)

That's a great simplification, especially with the use of "git -C <there>" construct to move there just for that single command. Very nice.

Previous: Christian Couder
Message 2 of 2 in “t9350: redirect input to only fast-import”
  1. t9350: redirect input to only fast-importChristian Couder, Jul 25, 2025
  2. Junio C HamanoJul 26, 2025

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.