threads / patch / 19201

patcht8005: use egrep when extended regular expressions are required

Subject: [PATCH] t8005: use egrep when extended regular expressions are required

## tl;dr

3 messages between May 6, 2009 and May 7, 2009. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Brandon Casey· May 6, 2009, 18:31 UTC · lore

Not all versions of grep understand backslashed extended regular expressions. Possibly only gnu grep does.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t8005-blame-i18n.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Show changes to t/t8005-blame-i18n.sh +4 −4
diff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh
index 4470a92..fcd5c26 100755
--- a/t/t8005-blame-i18n.sh
+++ b/t/t8005-blame-i18n.sh
@@ -36,7 +36,7 @@ EOF
 test_expect_success \
 	'blame respects i18n.commitencoding' '
 	git blame --incremental file | \
-		grep "^\(author\|summary\) " > actual &&
+		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
 '
 
@@ -53,7 +53,7 @@ test_expect_success \
 	'blame respects i18n.logoutputencoding' '
 	git config i18n.logoutputencoding cp1251 &&
 	git blame --incremental file | \
-		grep "^\(author\|summary\) " > actual &&
+		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
 '
 
@@ -69,7 +69,7 @@ EOF
 test_expect_success \
 	'blame respects --encoding=utf-8' '
 	git blame --incremental --encoding=utf-8 file | \
-		grep "^\(author\|summary\) " > actual &&
+		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
 '
 
@@ -85,7 +85,7 @@ EOF
 test_expect_success \
 	'blame respects --encoding=none' '
 	git blame --incremental --encoding=none file | \
-		grep "^\(author\|summary\) " > actual &&
+		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
 '
 
-- 
1.6.2.4.24.gde59d2
Junio C Hamano· May 6, 2009, 18:48 UTC · re: Brandon Casey · lore

Re: [PATCH] t8005: use egrep when extended regular expressions are required

Brandon Casey <casey@nrlssc.navy.mil> writes:
> Not all versions of grep understand backslashed extended regular
> expressions.  Possibly only gnu grep does.
Thanks.
Nguyen Thai Ngoc Duy· May 7, 2009, 00:12 UTC · re: Brandon Casey · lore

Re: [PATCH] t8005: use egrep when extended regular expressions are required

On Thu, May 7, 2009 at 4:31 AM, Brandon Casey <casey@nrlssc.navy.mil> wrote:
> Not all versions of grep understand backslashed extended regular
> expressions.  Possibly only gnu grep does.
>
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Works for me.
-- 
Duy

← back to recent threads