git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
May 6, 2009, 18:31 UTC
Message-ID
<oO0aWq8IlAMsKZ9ZA1BW41Q2yED3E3Gy0etERczi2cjwFaZDei2brNq_BxSt-DnUld4xgNrFZ64@cipher.nrlssc.navy.mil>

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(-)
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
Next: Junio C Hamano
Message 1 of 3 in “t8005: use egrep when extended regular expressions are required”
  1. t8005: use egrep when extended regular expressions are requiredBrandon Casey, May 6, 2009
  2. Junio C HamanoMay 6, 2009
  3. Nguyen Thai Ngoc DuyMay 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.