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

[PATCH] t1450: use egrep for regexp "alternation"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 28, 2017, 17:17 UTC
Message-ID
<xmqqinjgvxpr.fsf@gitster.mtv.corp.google.com>

GNU grep allows "\(A\|B\)" as alternation in BRE, but this is an extension not understood by some other implementations of grep (Michael Kebe reported an breakage on Solaris).

Rewrite the offending test to ERE and use egrep instead.
Noticed-by: Michael Kebe <michael.kebe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1450-fsck.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 8f52da2771..30e217dea2 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -541,7 +541,7 @@ test_expect_success 'fsck --name-objects' '
 		remove_loose_object $(git rev-parse julius:caesar.t) &&
 		test_must_fail git fsck --name-objects >out &&
 		tree=$(git rev-parse --verify julius:) &&
-		grep "$tree (\(refs/heads/master\|HEAD\)@{[0-9]*}:" out
+		egrep "$tree \((refs/heads/master|HEAD)@\{[0-9]*\}:" out
 	)
 '
 
-- 
2.13.2-655-gbf99380098
Message 1 of 1 in “t1450: use egrep for regexp "alternation"”
  1. t1450: use egrep for regexp "alternation"Junio C Hamano, Jun 28, 2017

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.