All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Shubham Mishra <shivam828787@gmail.com>
Cc: me@ttaylorr.com, avarab@gmail.com, git@vger.kernel.org
Subject: Re: [PATCH v2 2/2] t0030-t0050: avoid pipes with Git on LHS
Date: Sun, 27 Feb 2022 18:52:32 +0100	[thread overview]
Message-ID: <7e09ee3e-9ac6-e2ff-c6a4-3dd03303b576@kdbg.org> (raw)
In-Reply-To: <20220227122453.25278-3-shivam828787@gmail.com>

Am 27.02.22 um 13:24 schrieb Shubham Mishra:
>  test_expect_success \
>      'text plus spaces without newline at end should not show spaces' '
> -    ! (printf "$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (printf "$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (printf "$ttt$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (printf "$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (printf "$ttt$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (printf "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)
> +    printf "$ttt$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp >/dev/null &&
> +    printf "$ttt$ttt$sss" | git stripspace &&
> +    ! grep "  " tmp >/dev/null &&
> +    printf "$ttt$ttt$ttt$sss" | git stripspace &&
> +    ! grep "  " tmp >/dev/null &&
> +    printf "$ttt$sss$sss" | git stripspace &&
> +    ! grep "  " tmp >/dev/null &&
> +    printf "$ttt$ttt$sss$sss" | git stripspace &&
> +    ! grep "  " tmp >/dev/null &&
> +    printf "$ttt$sss$sss$sss" | git stripspace &&
> +    ! grep "  " tmp >/dev/null
>  '

You forgot to redirect all but the first `git stripspace`.

>  
>  test_expect_success \
> @@ -282,12 +292,18 @@ test_expect_success \
>  
>  test_expect_success \
>      'text plus spaces at end should not show spaces' '
> -    ! (echo "$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (echo "$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (echo "$ttt$ttt$ttt$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (echo "$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (echo "$ttt$ttt$sss$sss" | git stripspace | grep "  " >/dev/null) &&
> -    ! (echo "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)
> +    echo "$ttt$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp >/dev/null &&
> +    echo "$ttt$ttt$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp>/dev/null &&
> +    echo "$ttt$ttt$ttt$sss" &&
> +    ! grep "  " tmp >/dev/null &&
> +    echo "$ttt$sss$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp >/dev/null &&
> +    echo "$ttt$ttt$sss$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp >/dev/null &&
> +    echo "$ttt$sss$sss$sss" | git stripspace >tmp &&
> +    ! grep "  " tmp >/dev/null
>  '

A superficial glance at the visual pattern formed by the new lines
reveals immediately that there is something foul. And indeed, one of the
rewritten cases misses `| git stripspace >tmp`.

-- Hannes

  reply	other threads:[~2022-02-27 17:52 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=7e09ee3e-9ac6-e2ff-c6a4-3dd03303b576@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=shivam828787@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.