From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Elijah Newren <newren@gmail.com>, Jeff King <peff@peff.net>,
"brian m . carlson" <sandals@crustytoothpaste.net>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH] t9350: redirect input to only fast-import
Date: Sat, 26 Jul 2025 06:45:18 -0700 [thread overview]
Message-ID: <xmqqpldn12xd.fsf@gitster.g> (raw)
In-Reply-To: <20250725160536.2909011-1-christian.couder@gmail.com> (Christian Couder's message of "Fri, 25 Jul 2025 18:05:36 +0200")
Christian Couder <christian.couder@gmail.com> writes:
> 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.
prev parent reply other threads:[~2025-07-26 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 16:05 [PATCH] t9350: redirect input to only fast-import Christian Couder
2025-07-26 13:45 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpldn12xd.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=newren@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).