All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: git@vger.kernel.org, hji@dyntopia.com
Subject: Re: [PATCH] t: avoid alternation (not POSIX) in grep's BRE
Date: Fri, 29 May 2020 05:39:31 +0200	[thread overview]
Message-ID: <20200529033931.xb4jb4ewgdwtjknc@tb-raspi4> (raw)
In-Reply-To: <20200528083745.15273-1-carenas@gmail.com>

On Thu, May 28, 2020 at 01:37:45AM -0700, Carlo Marcelo Arenas Belón wrote:
> Using and escaped '|' for alternations is allowed in some implementations
        ^^^
Is this a typo ? "Using an escaped"...
And there are more typos and small things that deserve improvements.
> of grep (GNU and busybox, al least), but it is no suppored by POSIX[1]
> and therefore will fail in at least macOS and the BSD.

I don't think that macOS (or BSD) ever claimed to be be POSIX compliant.
How about something in this style:


Using an escaped '|' for alternations works only in some implementations
of grep (e.g. GNU and busybox).

It is not part of POSIX[1] and not supported by BSD, macOS
(and possibly other) non-GNU implementations.

Solution: Use ´grep -E´.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03


>
> Fixes: f1e3df3169 (t: increase test coverage of signature verification
>        output, 2020-03-04)
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  t/t4202-log.sh           | 2 +-
>  t/t6200-fmt-merge-msg.sh | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index f1ea7d97f5..a0930599aa 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -1692,7 +1692,7 @@ test_expect_success GPG 'log --graph --show-signature for merged tag with missin
>  	GNUPGHOME=. git log --graph --show-signature -n1 plain-nokey >actual &&
>  	grep "^|\\\  merged tag" actual &&
>  	grep "^| | gpg: Signature made" actual &&
> -	grep "^| | gpg: Can'"'"'t check signature: \(public key not found\|No public key\)" actual
> +	grep -E "^| | gpg: Can'"'"'t check signature: (public key not found|No public key)" actual
>  '
>
>  test_expect_success GPG 'log --graph --show-signature for merged tag with bad signature' '
> diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh
> index b15582a7a2..e4c2a6eca4 100755
> --- a/t/t6200-fmt-merge-msg.sh
> +++ b/t/t6200-fmt-merge-msg.sh
> @@ -103,7 +103,7 @@ test_expect_success GPG 'message for merging local tag signed by unknown key' '
>  	GNUPGHOME=. git fmt-merge-msg <.git/FETCH_HEAD >actual 2>&1 &&
>  	grep "^Merge tag ${apos}signed-good-tag${apos}" actual &&
>  	grep "^# gpg: Signature made" actual &&
> -	grep "^# gpg: Can${apos}t check signature: \(public key not found\|No public key\)" actual
> +	grep -E "^# gpg: Can${apos}t check signature: (public key not found|No public key)" actual
>  '
>
>  test_expect_success 'message for merging external branch' '
> --
> 2.27.0.rc2.257.gaada2199e1
>

  parent reply	other threads:[~2020-05-29  3:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  8:37 [PATCH] t: avoid alternation (not POSIX) in grep's BRE Carlo Marcelo Arenas Belón
2020-05-28 15:20 ` Junio C Hamano
2020-05-28 15:43   ` Jeff King
2020-05-28 15:51     ` Junio C Hamano
2020-05-28 16:52       ` Jeff King
2020-05-28 19:20         ` Junio C Hamano
2020-05-28 20:35           ` Jeff King
2020-05-29  3:18             ` digging into historical commit references Jeff King
2020-05-29  3:39 ` Torsten Bögershausen [this message]
2020-05-29  8:20 ` [PATCH v2] t: avoid alternation (not POSIX) in grep's BRE Carlo Marcelo Arenas Belón

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=20200529033931.xb4jb4ewgdwtjknc@tb-raspi4 \
    --to=tboegi@web.de \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hji@dyntopia.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.