# [PATCH] t7508: avoid non POSIX BRE

2 messages from 2021-08-01 to 2021-08-02. Participants: Carlo Marcelo Arenas Belón, Junio C Hamano.
Thread: https://gitlist.dev/t/56196

## Carlo Marcelo Arenas Belón, 2021-08-01 21:53

Subject: [PATCH] t7508: avoid non POSIX BRE
Message-ID: <20210801215300.53781-1-carenas@gmail.com>
URL: https://gitlist.dev/e/20210801215300.53781-1-carenas%40gmail.com

```
24c30e0b6 (wt-status: tolerate dangling marks, 2020-09-01) adds a test
that uses a BRE which breaks at least with OpenBSD's grep.

switch to an ERE as it is done for similar checks and while at it, remove
the now obsolete test_i18ngrep call.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 t/t7508-status.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 2b72451ba3..05c6c02435 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -882,7 +882,7 @@ test_expect_success 'status shows detached HEAD properly after checking out non-
 	git clone upstream downstream &&
 	git -C downstream checkout @{u} &&
 	git -C downstream status >actual &&
-	test_i18ngrep "HEAD detached at [0-9a-f]\\+" actual
+	grep -E "HEAD detached at [0-9a-f]+" actual
 '
 
 test_expect_success 'setup status submodule summary' '
-- 
2.32.0.826.g286871f41a


```

## Junio C Hamano, 2021-08-02 02:37

Subject: Re: [PATCH] t7508: avoid non POSIX BRE
Message-ID: <xmqqv94oy3le.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqv94oy3le.fsf%40gitster.g
In-Reply-To: <20210801215300.53781-1-carenas@gmail.com>

```
Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:

> 24c30e0b6 (wt-status: tolerate dangling marks, 2020-09-01) adds a test
> that uses a BRE which breaks at least with OpenBSD's grep.
>
> switch to an ERE as it is done for similar checks and while at it, remove
> the now obsolete test_i18ngrep call.

Thanks, obviously correct.

I wonder if we can more automate detection of such a bug---it is
unfortunate that it has become very hard to avoid GNUisms as
everybody, even Windows folks, is more likely to be with GNU tools
than BSD tools X-<.

>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  t/t7508-status.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t7508-status.sh b/t/t7508-status.sh
> index 2b72451ba3..05c6c02435 100755
> --- a/t/t7508-status.sh
> +++ b/t/t7508-status.sh
> @@ -882,7 +882,7 @@ test_expect_success 'status shows detached HEAD properly after checking out non-
>  	git clone upstream downstream &&
>  	git -C downstream checkout @{u} &&
>  	git -C downstream status >actual &&
> -	test_i18ngrep "HEAD detached at [0-9a-f]\\+" actual
> +	grep -E "HEAD detached at [0-9a-f]+" actual
>  '
>  
>  test_expect_success 'setup status submodule summary' '

```
