git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shubham Mishra <shivam828787@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git <git@vger.kernel.org>, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH 2/2] t0030-t0050: avoid pipes with Git on LHS
Date: Sat, 26 Feb 2022 17:39:22 +0530	[thread overview]
Message-ID: <CAC316V4a37rsVpemARu17h2e0bj=ahsWOxjBEwO=BiWou+4aBw@mail.gmail.com> (raw)
In-Reply-To: <220224.86o82wab31.gmgdl@evledraar.gmail.com>

Hi,

Thanks for Reviewing.

> You're modifying some tests here that are using some old coding style,
> so maybe it's better to adjust it while we're at it?
>
> Also I think this would be a lot nicer with test_stdout_line_count and a
> helper to deal with that pritnf, e.g.:
>
>         diff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh
>         index ae1ca380c1a..d48a3579511 100755
>         --- a/t/t0030-stripspace.sh
>         +++ b/t/t0030-stripspace.sh
>         @@ -223,12 +223,15 @@ test_expect_success \
>              test_cmp expect actual
>          '
>
>         -test_expect_success \
>         -    'text without newline at end should end with newline' '
>         -    test $(printf "$ttt" | git stripspace | wc -l) -gt 0 &&
>         -    test $(printf "$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
>         -    test $(printf "$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0 &&
>         -    test $(printf "$ttt$ttt$ttt$ttt" | git stripspace | wc -l) -gt 0
>         +printf_git_stripspace () {
>         +       printf "$1" | git stripspace
>         +}
>         +
>         +test_expect_success 'text without newline at end should end with newline' '
>         +       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt" &&
>         +       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt" &&
>         +       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt" &&
>         +       test_stdout_line_count -gt 0 printf_git_stripspace "$ttt$ttt$ttt$ttt"
>          '
>
>          # text plus spaces at the end:
>

it makes sense to improve this code as we are touching it, this way
looks much better. I will implement it.


> This is not on you, but generally we don't pipe "grep" to >/dev/null,
> and just let the --verbose option do its work.
I don't think I understood this, I guess you are talking about the
"-v" flag that stands for invert match? I didn't find "--verbose" with
grep.
Please correct me if I am wrong.

> With/without that change you no longer need the () subshell here.
sure.

Thanks,
Shubham

  reply	other threads:[~2022-02-26 12:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  5:47 [PATCH 0/2] Subject: [PATCH 0/2] [GSoC][PATCH 0/2] t0000-t0050: avoid pipes with Git on LHS Shubham Mishra
2022-02-24  5:47 ` [PATCH 1/2] t0001-t0028: " Shubham Mishra
2022-02-24  5:47 ` [PATCH 2/2] t0030-t0050: " Shubham Mishra
2022-02-24  8:59   ` Ævar Arnfjörð Bjarmason
2022-02-26 12:09     ` Shubham Mishra [this message]
2022-02-26 17:32     ` Taylor Blau
2022-02-27 12:24     ` [GSoC] [PATCH v2 0/2] " Shubham Mishra
2022-02-27 12:24       ` [PATCH v2 1/2] t0001-t0028: " Shubham Mishra
2022-02-27 17:43         ` Johannes Sixt
2022-03-03 12:48           ` Shubham Mishra
2022-02-27 12:24       ` [PATCH v2 2/2] t0030-t0050: " Shubham Mishra
2022-02-27 17:52         ` Johannes Sixt
2022-02-24  5:51 ` [PATCH 0/2] Subject: [PATCH 0/2] [GSoC][PATCH 0/2] t0000-t0050: " Shubham Mishra
2022-02-26 17:30   ` Taylor Blau
2022-03-12  6:21 ` [GSoC] [PATCH v3 0/2] " Shubham Mishra
2022-03-12  6:21   ` [PATCH v3 1/2] t0001-t0028: " Shubham Mishra
2022-03-12  6:21   ` [PATCH v3 2/2] t0030-t0050: " Shubham Mishra
2022-03-12  9:05   ` [GSoC] [PATCH v3 0/2] " Johannes Sixt
2022-03-12 10:27     ` Shubham Mishra

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC316V4a37rsVpemARu17h2e0bj=ahsWOxjBEwO=BiWou+4aBw@mail.gmail.com' \
    --to=shivam828787@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).