From: Junio C Hamano Date: Thu, 22 Oct 2026 17:24:03 GMT Subject: Re: [PATCH v2] [Outreachy PATCH] t0001: avoid pipes in test scripts Message-ID: In-Reply-To: "Srujith A Poojary via GitGitGadget" writes: > From: Srujith Poojary > > Avoid piping output from git version directly into sed to ensure > > that any command failure is properly caught by test scripts. > > Signed-off-by: Srujith Poojary > --- You do not want a blank line in the middle of a sentence. > diff --git a/t/t0001-init.sh b/t/t0001-init.sh > index f1d227f271..02217a9bf8 100755 > --- a/t/t0001-init.sh > +++ b/t/t0001-init.sh > @@ -678,7 +678,8 @@ test_expect_success 'default ref format' ' > sane_unset GIT_DEFAULT_REF_STORAGE_FORMAT && > git init refformat > ) && > - git version --build-options | sed -ne "s/^default-ref-storage-format: //p" >expect && > + git version --build-options >build-options && > + sed -ne "s/^default-ref-storage-format: //p" build-options >expect && Unnecessary indentation. The only reason why you thought it was needed was because the original was (wrongly) expressed as a single pipeline. Once that glitch is gone, anybody reading the resulting code has no reason to think that this "sed" is associated stronger to the previous "git version" than with the next "git rev-parse" line. > git -C refformat rev-parse --show-ref-storage-format >actual && > test_cmp expect actual > ' > > base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd