Re: [PATCH] t0008: 4 tests fail with ksh88

Subsystems: the rest

3 messages, 3 authors, 2016-06-16 · open the first message on its own page

Re: [PATCH] t0008: 4 tests fail with ksh88

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:32

Junio C Hamano [off-list ref] writes:
quoted
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 89544dd..b425f3a 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -605,7 +605,7 @@ cat <<-EOF >expected-verbose
        a/b/.gitignore:8:!on*   a/b/one
        a/b/.gitignore:8:!on*   a/b/one one
The patch was whitespace-damaged and didn't apply, so I had to redo
it from scratch while updating the log message.  If this looks good
to you, there is no need to resend.

Thanks.

-- >8 --
From: Armin Kunaschik <redacted>
Date: Fri, 20 May 2016 16:31:30 +0200
Subject: [PATCH] t0008: 4 tests fail with ksh88

In t0008, we have

	cat <<-EOF
	...
	a/b/.gitignore:8:!on*	"a/b/one\"three"
	...
	EOF

ane expect that the backslash-dq is passed through literally.

ksh88 eats \ and generates a wrong expect data to compare with.

Using \\" works this around without breaking other POSIX shells
(which collapse backslash-backslash to a single backslash), and
ksh88 does so, too.

It makes it easier to read, too, because the reason why we are
writing backslash there is *not* because we think dq is special and
want to quote it (if that were the case we would have two more
backslashes on that line).  It is simply because we want a single
literal backslash there.  Since backslash is treated specially in
unquoted here-document, explicitly doubling it to quote it expresses
our intent better than relying on the character that immediately
comes after it (i.e. '"') not being a special character.

Signed-off-by: Armin Kunaschik <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 t/t0008-ignores.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 89544dd..b425f3a 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -605,7 +605,7 @@ cat <<-EOF >expected-verbose
 	a/b/.gitignore:8:!on*	a/b/one
 	a/b/.gitignore:8:!on*	a/b/one one
 	a/b/.gitignore:8:!on*	a/b/one two
-	a/b/.gitignore:8:!on*	"a/b/one\"three"
+	a/b/.gitignore:8:!on*	"a/b/one\\"three"
 	a/b/.gitignore:9:!two	a/b/two
 	a/.gitignore:1:two*	a/b/twooo
 	$global_excludes:2:!globaltwo	globaltwo
@@ -686,7 +686,7 @@ cat <<-EOF >expected-all
 	a/b/.gitignore:8:!on*	b/one
 	a/b/.gitignore:8:!on*	b/one one
 	a/b/.gitignore:8:!on*	b/one two
-	a/b/.gitignore:8:!on*	"b/one\"three"
+	a/b/.gitignore:8:!on*	"b/one\\"three"
 	a/b/.gitignore:9:!two	b/two
 	::	b/not-ignored
 	a/.gitignore:1:two*	b/twooo
-- 
2.8.3-625-g89e3711

Re: [PATCH] t0008: 4 tests fail with ksh88

From: Armin Kunaschik <hidden>
Date: 2016-06-16 02:19:32

On Fri, May 20, 2016 at 6:10 PM, Junio C Hamano [off-list ref] wrote:
Junio C Hamano [off-list ref] writes:
quoted
quoted
diff --git a/t/t0008-ignores.sh b/t/t0008-ignores.sh
index 89544dd..b425f3a 100755
--- a/t/t0008-ignores.sh
+++ b/t/t0008-ignores.sh
@@ -605,7 +605,7 @@ cat <<-EOF >expected-verbose
        a/b/.gitignore:8:!on*   a/b/one
        a/b/.gitignore:8:!on*   a/b/one one
The patch was whitespace-damaged and didn't apply, so I had to redo
it from scratch while updating the log message.  If this looks good
to you, there is no need to resend.
Thanks. Looks like even Google Mail interface in plain text mode eats
white spaces :-(

Re: [PATCH] t0008: 4 tests fail with ksh88

From: Christian Couder <hidden>
Date: 2016-06-16 02:19:32

On Fri, May 20, 2016 at 6:10 PM, Junio C Hamano [off-list ref] wrote:
Junio C Hamano [off-list ref] writes:

From: Armin Kunaschik <redacted>
Date: Fri, 20 May 2016 16:31:30 +0200
Subject: [PATCH] t0008: 4 tests fail with ksh88

In t0008, we have

        cat <<-EOF
        ...
        a/b/.gitignore:8:!on*   "a/b/one\"three"
        ...
        EOF

ane expect that the backslash-dq is passed through literally.
s/ane/and/
ksh88 eats \ and generates a wrong expect data to compare with.

Using \\" works this around without breaking other POSIX shells
(which collapse backslash-backslash to a single backslash), and
ksh88 does so, too.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help