[PATCH] t/t7600: avoid GNUism in grep

Subsystems: the rest

DORMANTno replies

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] t/t7600: avoid GNUism in grep

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:02

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

Signed-off-by: Junio C Hamano <redacted>
---

 * 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

Re: [PATCH] t/t7600: avoid GNUism in grep

From: Charles Bailey <hidden>
Date: 2016-06-15 22:44:02

Junio C Hamano wrote:
quoted hunk
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
I'm not sure that you quite made the change you meant to change in the 
second chunk ( '  +' vs. '  *' ? ).

Charles.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help