From: Junio C Hamano <gitster@pobox.com>
To: "Srujith A Poojary via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Usman Akinyemi <usmanakinyemi202@gmail.com>,
Srujith A Poojary <poojarysrujith@gmail.com>
Subject: Re: [PATCH v2] [Outreachy PATCH] t0001: avoid pipes in test scripts
Date: Thu, 22 Oct 2026 10:24:03 -0700 [thread overview]
Message-ID: <xmqqbj8lhcng.fsf@gitster.g> (raw)
In-Reply-To: <pull.2260.v2.git.1792666211685.gitgitgadget@gmail.com> (Srujith A. Poojary via GitGitGadget's message of "Thu, 22 Oct 2026 10:50:11 +0000")
"Srujith A Poojary via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Srujith Poojary <poojarysrujith@gmail.com>
>
> 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 <poojarysrujith@gmail.com>
> ---
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
next prev parent reply other threads:[~2026-10-22 17:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 4:55 [PATCH] [Outreachy PATCH] t0001: avoid pipes in test scripts Srujith A Poojary via GitGitGadget
2026-10-21 22:03 ` Usman Akinyemi
2026-10-22 10:50 ` [PATCH v2] " Srujith A Poojary via GitGitGadget
2026-10-22 10:53 ` Srujith Poojary
2026-10-22 17:24 ` Junio C Hamano [this message]
2026-10-23 4:34 ` Srujith Poojary
2026-10-23 5:13 ` [PATCH v3] " Srujith A Poojary via GitGitGadget
2026-10-23 16:23 ` Srujith Poojary
2026-10-29 12:12 ` Patrick Steinhardt
2026-10-29 14:36 ` Srujith Poojary
2026-10-29 14:34 ` [PATCH v4] " Srujith A Poojary via GitGitGadget
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=xmqqbj8lhcng.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=poojarysrujith@gmail.com \
--cc=usmanakinyemi202@gmail.com \
/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