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

[PATCH] t/t7600: avoid GNUism in grep

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 5, 2008, 06:50 UTC
Message-ID
<7v63y8g40u.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1199506008-12225-1-git-send-email-vmiklos@frugalware.org>

Using \+ to mean "one or more" in grep without -E is a GNU extension outside POSIX. Avoid it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * I do not think these clean-ups are particularly necessary
   right now, but as we noticed it why not...
 t/t7600-merge.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 6424c6e..21862ac 100755
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
@@ -371,7 +371,7 @@ test_expect_success 'override config option -n' '
 	git merge --summary c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
 	verify_parents $c1 $c2 &&
-	if ! grep -e "^ file | \+2 +-$" diffstat.txt
+	if ! grep -e "^ file |  *2 +-$" diffstat.txt
 	then
 		echo "[OOPS] diffstat was not generated"
 	fi
@@ -386,7 +386,7 @@ test_expect_success 'override config option --summary' '
 	git merge -n c2 >diffstat.txt &&
 	verify_merge file result.1-5 msg.1-5 &&
 	verify_parents $c1 $c2 &&
-	if grep -e "^ file | \+2 +-$" diffstat.txt
+	if grep -e "^ file |  +2 +-$" diffstat.txt
 	then
 		echo "[OOPS] diffstat was generated"
 		false
-- 
1.5.4.rc2.17.g257f
Previous: Junio C HamanoNext: Charles Bailey
Message 2 of 4 in “t/t3800: do not use a temporary file to hold expected result.”
  1. t/t3800: do not use a temporary file to hold expected result.Junio C Hamano, Jan 5, 2008
  2. t/t7600: avoid GNUism in grepJunio C Hamano, Jan 5, 2008
  3. Charles BaileyJan 5, 2008
  4. Junio C HamanoJan 5, 2008

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.