git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t: use LF variable defined in the test harness
@ 2019-09-03 21:11 Junio C Hamano
  2019-09-04  0:29 ` Taylor Blau
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2019-09-03 21:11 UTC (permalink / raw)
  To: git

A few test scripts assign a single LF to $LF, but that is already
given by test-lib.sh to everybody.

Remove the unnecessary reassignment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t3404-rebase-interactive.sh | 2 --
 t/t4013-diff-various.sh       | 3 ---
 t/t5515-fetch-merge-logic.sh  | 3 ---
 3 files changed, 8 deletions(-)

diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 461dd539ff..31114d0bbb 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -155,8 +155,6 @@ test_expect_success 'rebase -x with empty command fails' '
 	test_i18ncmp expected actual
 '
 
-LF='
-'
 test_expect_success 'rebase -x with newline in command fails' '
 	test_when_finished "git rebase --abort ||:" &&
 	test_must_fail env git rebase -x "a${LF}b" @ 2>actual &&
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index a9054d2db1..5ac94b390d 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -7,9 +7,6 @@ test_description='Various diff formatting options'
 
 . ./test-lib.sh
 
-LF='
-'
-
 test_expect_success setup '
 
 	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index e55d8474ef..961eb35c99 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -12,9 +12,6 @@ GIT_TEST_PROTOCOL_VERSION=
 
 . ./test-lib.sh
 
-LF='
-'
-
 test_expect_success setup '
 	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
 	GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use LF variable defined in the test harness
  2019-09-03 21:11 [PATCH] t: use LF variable defined in the test harness Junio C Hamano
@ 2019-09-04  0:29 ` Taylor Blau
  2019-09-05 18:17   ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Taylor Blau @ 2019-09-04  0:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi Junio,

On Tue, Sep 03, 2019 at 02:11:22PM -0700, Junio C Hamano wrote:
> A few test scripts assign a single LF to $LF, but that is already
> given by test-lib.sh to everybody.

I didn't know that 't/test-lib.sh' provided '$LF' (as I'm sure was the
case for the respective authors of those tests below ;-)), so removing
the bespoke definitions and relying on the one already defined makes
good sense.

> Remove the unnecessary reassignment.

I did find a couple of extra spots when I went looking through 't'
myself. I ran:

  $ git grep "='$" -- t

which in addition to the three spots below turned up a couple more
interesting locations, as well as a few false positives. They are:

  - t/t3005: this script calls the variable '$new_line', but could be
    renamed to LF and then removed in a second patch

  - t/valgrind/analyze.sh: this script also calls the variable
    '$new_line', but does not ever source test-lib.sh, so I think this
    spot can be ignored.

So I think that my recommendation is to either:

  * introduce a prepratory patch that updates t3005 to rename
    '$new_line' to '$LF', and then amend the patch below to also blow
    away t3005's use of '$LF', or

  * do both steps in one larger patch

> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  t/t3404-rebase-interactive.sh | 2 --
>  t/t4013-diff-various.sh       | 3 ---
>  t/t5515-fetch-merge-logic.sh  | 3 ---
>  3 files changed, 8 deletions(-)
>
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 461dd539ff..31114d0bbb 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -155,8 +155,6 @@ test_expect_success 'rebase -x with empty command fails' '
>  	test_i18ncmp expected actual
>  '
>
> -LF='
> -'
>  test_expect_success 'rebase -x with newline in command fails' '
>  	test_when_finished "git rebase --abort ||:" &&
>  	test_must_fail env git rebase -x "a${LF}b" @ 2>actual &&
> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
> index a9054d2db1..5ac94b390d 100755
> --- a/t/t4013-diff-various.sh
> +++ b/t/t4013-diff-various.sh
> @@ -7,9 +7,6 @@ test_description='Various diff formatting options'
>
>  . ./test-lib.sh
>
> -LF='
> -'
> -
>  test_expect_success setup '
>
>  	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
> diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
> index e55d8474ef..961eb35c99 100755
> --- a/t/t5515-fetch-merge-logic.sh
> +++ b/t/t5515-fetch-merge-logic.sh
> @@ -12,9 +12,6 @@ GIT_TEST_PROTOCOL_VERSION=
>
>  . ./test-lib.sh
>
> -LF='
> -'
> -
>  test_expect_success setup '
>  	GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
>  	GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&

The rest of the patch here looks obviously good.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use LF variable defined in the test harness
  2019-09-04  0:29 ` Taylor Blau
@ 2019-09-05 18:17   ` Junio C Hamano
  2019-09-05 18:47     ` Jeff King
  2019-09-05 18:52     ` [PATCH] t: use LF variable defined in the test harness Taylor Blau
  0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2019-09-05 18:17 UTC (permalink / raw)
  To: Taylor Blau; +Cc: git

Taylor Blau <me@ttaylorr.com> writes:

>   - t/t3005: this script calls the variable '$new_line', but could be
>     renamed to LF and then removed in a second patch

It is worse than that, isn't it?

If it used $new_line, then it would probably have been a good idea
to somehow make a separate patch related to this one and make a
series about "use $LF from test-lib", but ever since its beginning
at 0f64bfa9 ("ls-files: fix pathspec display on error", 2011-08-01),
$new_line is assigned once but never used in the script.

Somebody may want to go clean-up the use of various $sq and $SQ
locally defined by giving a unified $SQ in test-lib.sh, by the way.

-- >8 --
Subject: t3005: remove unused variable

Since the beginning of the script, $new_line variable was never used.
Remove it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t3005-ls-files-relative.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
index 209b4c7cd8..583e467683 100755
--- a/t/t3005-ls-files-relative.sh
+++ b/t/t3005-ls-files-relative.sh
@@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.
 
 . ./test-lib.sh
 
-new_line='
-'
 sq=\'
 
 test_expect_success 'prepare' '

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use LF variable defined in the test harness
  2019-09-05 18:17   ` Junio C Hamano
@ 2019-09-05 18:47     ` Jeff King
  2019-09-05 19:34       ` Junio C Hamano
  2019-09-05 18:52     ` [PATCH] t: use LF variable defined in the test harness Taylor Blau
  1 sibling, 1 reply; 10+ messages in thread
From: Jeff King @ 2019-09-05 18:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Taylor Blau, git

On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:

> Somebody may want to go clean-up the use of various $sq and $SQ
> locally defined by giving a unified $SQ in test-lib.sh, by the way.

Maybe good #leftoverbits material, since we may have Outreachy
applications coming up soon.

-Peff

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use LF variable defined in the test harness
  2019-09-05 18:17   ` Junio C Hamano
  2019-09-05 18:47     ` Jeff King
@ 2019-09-05 18:52     ` Taylor Blau
  1 sibling, 0 replies; 10+ messages in thread
From: Taylor Blau @ 2019-09-05 18:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Taylor Blau, git

On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:
> Taylor Blau <me@ttaylorr.com> writes:
>
> >   - t/t3005: this script calls the variable '$new_line', but could be
> >     renamed to LF and then removed in a second patch
>
> It is worse than that, isn't it?
>
> If it used $new_line, then it would probably have been a good idea
> to somehow make a separate patch related to this one and make a
> series about "use $LF from test-lib", but ever since its beginning
> at 0f64bfa9 ("ls-files: fix pathspec display on error", 2011-08-01),
> $new_line is assigned once but never used in the script.

Ah, thanks for catching it ;-). I think the patch below the scissors is
totally right; there's obviously no need for a preparatory patch here
other than the one you provided.

> Somebody may want to go clean-up the use of various $sq and $SQ
> locally defined by giving a unified $SQ in test-lib.sh, by the way.
>
> -- >8 --
> Subject: t3005: remove unused variable
>
> Since the beginning of the script, $new_line variable was never used.
> Remove it.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  t/t3005-ls-files-relative.sh | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
> index 209b4c7cd8..583e467683 100755
> --- a/t/t3005-ls-files-relative.sh
> +++ b/t/t3005-ls-files-relative.sh
> @@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.
>
>  . ./test-lib.sh
>
> -new_line='
> -'
>  sq=\'
>
>  test_expect_success 'prepare' '

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use LF variable defined in the test harness
  2019-09-05 18:47     ` Jeff King
@ 2019-09-05 19:34       ` Junio C Hamano
  2019-09-05 22:10         ` [PATCH] t: use common $SQ variable Denton Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2019-09-05 19:34 UTC (permalink / raw)
  To: Jeff King; +Cc: Taylor Blau, git

Jeff King <peff@peff.net> writes:

> On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:
>
>> Somebody may want to go clean-up the use of various $sq and $SQ
>> locally defined by giving a unified $SQ in test-lib.sh, by the way.
>
> Maybe good #leftoverbits material, since we may have Outreachy
> applications coming up soon.

OK, then I'd refrain from doing it as a lunchtime hack myself ;-)

 * Find sq=, $sq and ${sq} case insensitively in t/.  If there is
   any use of $SQ that does not want a single quote in it, abort
   the whole thing.  Otherwise proceed.

 * Introduce an assignment SQ=\' in t/test-lib.sh, next to where LF
   is assigned to.  Replace all uses you found in #1 with reference
   to $SQ.

#leftoverbits.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] t: use common $SQ variable
  2019-09-05 19:34       ` Junio C Hamano
@ 2019-09-05 22:10         ` Denton Liu
  2019-09-05 22:25           ` Taylor Blau
  2019-09-06  2:04           ` Denton Liu
  0 siblings, 2 replies; 10+ messages in thread
From: Denton Liu @ 2019-09-05 22:10 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Jeff King, Taylor Blau

In many test scripts, there are bespoke definitions of the single quote
that are some variation of this:

    SQ="'"

Define a common $SQ variable in test-lib.sh and replace all usages of
these bespoke variables with the common one.

This change was done by running `git grep =\"\'\" t/` and
`git grep =\\\\\'` and manually changing the resulting definitions and
corresponding usages.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---

[whoops, forgot to include the mailing list in the last email]

Sorry, I wrote this patch up before I saw the email about leaving this
as #leftoverbits. No point in letting it go to waste, though.

 t/t1300-config.sh              |  9 +++--
 t/t1404-update-ref-errors.sh   | 64 ++++++++++++++++------------------
 t/t1414-reflog-walk.sh         |  3 +-
 t/t1506-rev-parse-diagnosis.sh |  5 ++-
 t/t1507-rev-parse-upstream.sh  | 12 +++----
 t/t3005-ls-files-relative.sh   |  9 +++--
 t/t3404-rebase-interactive.sh  |  1 -
 t/t3430-rebase-merges.sh       |  1 -
 t/t5601-clone.sh               |  1 -
 t/t7406-submodule-update.sh    |  3 +-
 t/test-lib.sh                  |  3 ++
 11 files changed, 51 insertions(+), 60 deletions(-)

diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 428177c390..983a0a1583 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1294,26 +1294,25 @@ test_expect_success 'git -c is not confused by empty environment' '
 	GIT_CONFIG_PARAMETERS="" git -c x.one=1 config --list
 '
 
-sq="'"
 test_expect_success 'detect bogus GIT_CONFIG_PARAMETERS' '
 	cat >expect <<-\EOF &&
 	env.one one
 	env.two two
 	EOF
-	GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq} ${sq}env.two=two${sq}" \
+	GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ} ${SQ}env.two=two${SQ}" \
 		git config --get-regexp "env.*" >actual &&
 	test_cmp expect actual &&
 
 	cat >expect <<-EOF &&
-	env.one one${sq}
+	env.one one${SQ}
 	env.two two
 	EOF
-	GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq}\\$sq$sq$sq ${sq}env.two=two${sq}" \
+	GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ}\\$SQ$SQ$SQ ${SQ}env.two=two${SQ}" \
 		git config --get-regexp "env.*" >actual &&
 	test_cmp expect actual &&
 
 	test_must_fail env \
-		GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq}\\$sq ${sq}env.two=two${sq}" \
+		GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ}\\$SQ ${SQ}env.two=two${SQ}" \
 		git config --get-regexp "env.*"
 '
 
diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index 970c5c36b9..2d142e5535 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -32,8 +32,6 @@ test_update_rejected () {
 	test_cmp unchanged actual
 }
 
-Q="'"
-
 # Test adding and deleting D/F-conflicting references in a single
 # transaction.
 df_test() {
@@ -93,7 +91,7 @@ df_test() {
 		delname="$delref"
 	fi &&
 	cat >expected-err <<-EOF &&
-	fatal: cannot lock ref $Q$addname$Q: $Q$delref$Q exists; cannot create $Q$addref$Q
+	fatal: cannot lock ref $SQ$addname$SQ: $SQ$delref$SQ exists; cannot create $SQ$addref$SQ
 	EOF
 	$pack &&
 	if $add_del
@@ -123,7 +121,7 @@ test_expect_success 'existing loose ref is a simple prefix of new' '
 
 	prefix=refs/1l &&
 	test_update_rejected "a c e" false "b c/x d" \
-		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"
+		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ"
 
 '
 
@@ -131,7 +129,7 @@ test_expect_success 'existing packed ref is a simple prefix of new' '
 
 	prefix=refs/1p &&
 	test_update_rejected "a c e" true "b c/x d" \
-		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"
+		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ"
 
 '
 
@@ -139,7 +137,7 @@ test_expect_success 'existing loose ref is a deeper prefix of new' '
 
 	prefix=refs/2l &&
 	test_update_rejected "a c e" false "b c/x/y d" \
-		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"
+		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ"
 
 '
 
@@ -147,7 +145,7 @@ test_expect_success 'existing packed ref is a deeper prefix of new' '
 
 	prefix=refs/2p &&
 	test_update_rejected "a c e" true "b c/x/y d" \
-		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"
+		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ"
 
 '
 
@@ -155,7 +153,7 @@ test_expect_success 'new ref is a simple prefix of existing loose' '
 
 	prefix=refs/3l &&
 	test_update_rejected "a c/x e" false "b c d" \
-		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"
+		"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ"
 
 '
 
@@ -163,7 +161,7 @@ test_expect_success 'new ref is a simple prefix of existing packed' '
 
 	prefix=refs/3p &&
 	test_update_rejected "a c/x e" true "b c d" \
-		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"
+		"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ"
 
 '
 
@@ -171,7 +169,7 @@ test_expect_success 'new ref is a deeper prefix of existing loose' '
 
 	prefix=refs/4l &&
 	test_update_rejected "a c/x/y e" false "b c d" \
-		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"
+		"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ"
 
 '
 
@@ -179,7 +177,7 @@ test_expect_success 'new ref is a deeper prefix of existing packed' '
 
 	prefix=refs/4p &&
 	test_update_rejected "a c/x/y e" true "b c d" \
-		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"
+		"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ"
 
 '
 
@@ -187,7 +185,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
 
 	prefix=refs/5 &&
 	test_update_rejected "a e" false "b c c/x d" \
-		"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time"
+		"cannot process $SQ$prefix/c$SQ and $SQ$prefix/c/x$SQ at the same time"
 
 '
 
@@ -334,7 +332,7 @@ test_expect_success 'D/F conflict prevents indirect delete long packed + indirec
 test_expect_success 'missing old value blocks update' '
 	prefix=refs/missing-update &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/foo $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -345,7 +343,7 @@ test_expect_success 'incorrect old value blocks update' '
 	prefix=refs/incorrect-update &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "update $prefix/foo $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -356,7 +354,7 @@ test_expect_success 'existing old value blocks create' '
 	prefix=refs/existing-create &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: reference already exists
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: reference already exists
 	EOF
 	printf "%s\n" "create $prefix/foo $E" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -367,7 +365,7 @@ test_expect_success 'incorrect old value blocks delete' '
 	prefix=refs/incorrect-delete &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "delete $prefix/foo $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -378,7 +376,7 @@ test_expect_success 'missing old value blocks indirect update' '
 	prefix=refs/missing-indirect-update &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/symref $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -390,7 +388,7 @@ test_expect_success 'incorrect old value blocks indirect update' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "update $prefix/symref $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -402,7 +400,7 @@ test_expect_success 'existing old value blocks indirect create' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: reference already exists
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists
 	EOF
 	printf "%s\n" "create $prefix/symref $E" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -414,7 +412,7 @@ test_expect_success 'incorrect old value blocks indirect delete' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "delete $prefix/symref $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -425,7 +423,7 @@ test_expect_success 'missing old value blocks indirect no-deref update' '
 	prefix=refs/missing-noderef-update &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: reference is missing but expected $D
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference is missing but expected $D
 	EOF
 	printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -437,7 +435,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -449,7 +447,7 @@ test_expect_success 'existing old value blocks indirect no-deref create' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: reference already exists
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists
 	EOF
 	printf "%s\n" "option no-deref" "create $prefix/symref $E" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -461,7 +459,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	git update-ref $prefix/foo $C &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
 	EOF
 	printf "%s\n" "option no-deref" "delete $prefix/symref $D" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -474,13 +472,13 @@ test_expect_success 'non-empty directory blocks create' '
 	: >.git/$prefix/foo/bar/baz.lock &&
 	test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/foo $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
 	test_cmp expected output.err &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/foo $D $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -493,13 +491,13 @@ test_expect_success 'broken reference blocks create' '
 	echo "gobbledigook" >.git/$prefix/foo &&
 	test_when_finished "rm -f .git/$prefix/foo" &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
 	EOF
 	printf "%s\n" "update $prefix/foo $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
 	test_cmp expected output.err &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
+	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
 	EOF
 	printf "%s\n" "update $prefix/foo $D $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -513,13 +511,13 @@ test_expect_success 'non-empty directory blocks indirect create' '
 	: >.git/$prefix/foo/bar/baz.lock &&
 	test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/symref $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
 	test_cmp expected output.err &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
 	EOF
 	printf "%s\n" "update $prefix/symref $D $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -532,13 +530,13 @@ test_expect_success 'broken reference blocks indirect create' '
 	echo "gobbledigook" >.git/$prefix/foo &&
 	test_when_finished "rm -f .git/$prefix/foo" &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
 	EOF
 	printf "%s\n" "update $prefix/symref $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
 	test_cmp expected output.err &&
 	cat >expected <<-EOF &&
-	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
+	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
 	EOF
 	printf "%s\n" "update $prefix/symref $D $C" |
 	test_must_fail git update-ref --stdin 2>output.err &&
@@ -614,7 +612,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
 	test_when_finished "rm -f .git/packed-refs.lock" &&
 	test_must_fail git update-ref -d $prefix/foo >out 2>err &&
 	git for-each-ref $prefix >actual &&
-	test_i18ngrep "Unable to create $Q.*packed-refs.lock$Q: " err &&
+	test_i18ngrep "Unable to create $SQ.*packed-refs.lock$SQ: " err &&
 	test_cmp unchanged actual
 '
 
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index feb1efd8ff..1181a9fb28 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -18,10 +18,9 @@ do_walk () {
 	git log -g --format="%gd %gs" "$@"
 }
 
-sq="'"
 test_expect_success 'set up expected reflog' '
 	cat >expect.all <<-EOF
-	HEAD@{0} commit (merge): Merge branch ${sq}master${sq} into side
+	HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
 	HEAD@{1} commit: three
 	HEAD@{2} checkout: moving from master to side
 	HEAD@{3} commit: two
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 4ee009da66..21a9c8ffb2 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -8,10 +8,9 @@ exec </dev/null
 
 test_did_you_mean ()
 {
-	sq="'" &&
 	cat >expected <<-EOF &&
-	fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
-	Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
+	fatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.
+	Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
 	EOF
 	test_cmp expected error
 }
diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
index fa3e499641..8b4cf8a6e3 100755
--- a/t/t1507-rev-parse-upstream.sh
+++ b/t/t1507-rev-parse-upstream.sh
@@ -28,8 +28,6 @@ test_expect_success 'setup' '
 	)
 '
 
-sq="'"
-
 full_name () {
 	(cd clone &&
 	 git rev-parse --symbolic-full-name "$@")
@@ -129,7 +127,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '
 	git branch -t new my-side@{u} &&
 	git merge -s ours new@{u} &&
 	git show -s --pretty=tformat:%s >actual &&
-	echo "Merge remote-tracking branch ${sq}origin/side${sq}" >expect &&
+	echo "Merge remote-tracking branch ${SQ}origin/side${SQ}" >expect &&
 	test_cmp expect actual
 )
 '
@@ -156,7 +154,7 @@ test_expect_success 'branch@{u} works when tracking a local branch' '
 
 test_expect_success 'branch@{u} error message when no upstream' '
 	cat >expect <<-EOF &&
-	fatal: no upstream configured for branch ${sq}non-tracking${sq}
+	fatal: no upstream configured for branch ${SQ}non-tracking${SQ}
 	EOF
 	error_message non-tracking@{u} &&
 	test_i18ncmp expect error
@@ -164,7 +162,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
 
 test_expect_success '@{u} error message when no upstream' '
 	cat >expect <<-EOF &&
-	fatal: no upstream configured for branch ${sq}master${sq}
+	fatal: no upstream configured for branch ${SQ}master${SQ}
 	EOF
 	test_must_fail git rev-parse --verify @{u} 2>actual &&
 	test_i18ncmp expect actual
@@ -172,7 +170,7 @@ test_expect_success '@{u} error message when no upstream' '
 
 test_expect_success 'branch@{u} error message with misspelt branch' '
 	cat >expect <<-EOF &&
-	fatal: no such branch: ${sq}no-such-branch${sq}
+	fatal: no such branch: ${SQ}no-such-branch${SQ}
 	EOF
 	error_message no-such-branch@{u} &&
 	test_i18ncmp expect error
@@ -189,7 +187,7 @@ test_expect_success '@{u} error message when not on a branch' '
 
 test_expect_success 'branch@{u} error message if upstream branch not fetched' '
 	cat >expect <<-EOF &&
-	fatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch
+	fatal: upstream branch ${SQ}refs/heads/side${SQ} not stored as a remote-tracking branch
 	EOF
 	error_message bad-upstream@{u} &&
 	test_i18ncmp expect error
diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
index 209b4c7cd8..c841f9b454 100755
--- a/t/t3005-ls-files-relative.sh
+++ b/t/t3005-ls-files-relative.sh
@@ -9,7 +9,6 @@ This test runs git ls-files with various relative path arguments.
 
 new_line='
 '
-sq=\'
 
 test_expect_success 'prepare' '
 	: >never-mind-me &&
@@ -44,9 +43,9 @@ test_expect_success 'ls-files -c' '
 		cd top/sub &&
 		for f in ../y*
 		do
-			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
+			echo "error: pathspec $SQ$f$SQ did not match any file(s) known to git"
 		done >expect.err &&
-		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
+		echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
 		ls ../x* >expect.out &&
 		test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
 		test_cmp expect.out actual.out &&
@@ -59,9 +58,9 @@ test_expect_success 'ls-files -o' '
 		cd top/sub &&
 		for f in ../x*
 		do
-			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
+			echo "error: pathspec $SQ$f$SQ did not match any file(s) known to git"
 		done >expect.err &&
-		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
+		echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
 		ls ../y* >expect.out &&
 		test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
 		test_cmp expect.out actual.out &&
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 461dd539ff..9c152b6245 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1419,7 +1419,6 @@ test_expect_success 'editor saves as CR/LF' '
 	)
 '
 
-SQ="'"
 test_expect_success 'rebase -i --gpg-sign=<key-id>' '
 	test_when_finished "test_might_fail git rebase --abort" &&
 	set_fake_editor &&
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 7b6c4847ad..11141ac864 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -151,7 +151,6 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
 	test_path_is_file .git/rebase-merge/patch
 '
 
-SQ="'"
 test_expect_success 'failed `merge <branch>` does not crash' '
 	test_when_finished "test_might_fail git rebase --abort" &&
 	git checkout conflicting-G &&
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 4a3b901f06..3be025a658 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -434,7 +434,6 @@ test_expect_success 'double quoted plink.exe in GIT_SSH_COMMAND' '
 	expect_ssh "-v -P 123" myhost src
 '
 
-SQ="'"
 test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' '
 	copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" &&
 	GIT_SSH_COMMAND="$SQ$TRASH_DIRECTORY/plink.exe$SQ -v" \
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index c973278300..df34c994d2 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -158,7 +158,6 @@ test_expect_success 'submodule update --init from and of subdirectory' '
 	test_i18ncmp expect2 actual2
 '
 
-apos="'";
 test_expect_success 'submodule update does not fetch already present commits' '
 	(cd submodule &&
 	  echo line3 >> file &&
@@ -168,7 +167,7 @@ test_expect_success 'submodule update does not fetch already present commits' '
 	) &&
 	(cd super/submodule &&
 	  head=$(git rev-parse --verify HEAD) &&
-	  echo "Submodule path ${apos}submodule$apos: checked out $apos$head$apos" > ../../expected &&
+	  echo "Submodule path ${SQ}submodule$SQ: checked out $SQ$head$SQ" > ../../expected &&
 	  git reset --hard HEAD~1
 	) &&
 	(cd super &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a9d45642a5..ee602c4d9c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -509,6 +509,9 @@ EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
 LF='
 '
 
+# Single quote
+SQ=\'
+
 # UTF-8 ZERO WIDTH NON-JOINER, which HFS+ ignores
 # when case-folding filenames
 u200c=$(printf '\342\200\214')
-- 
2.23.0.37.g745f681289


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use common $SQ variable
  2019-09-05 22:10         ` [PATCH] t: use common $SQ variable Denton Liu
@ 2019-09-05 22:25           ` Taylor Blau
  2019-09-05 22:27             ` Taylor Blau
  2019-09-06  2:04           ` Denton Liu
  1 sibling, 1 reply; 10+ messages in thread
From: Taylor Blau @ 2019-09-05 22:25 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, Junio C Hamano, Jeff King, Taylor Blau

On Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:
> In many test scripts, there are bespoke definitions of the single quote
> that are some variation of this:
>
>     SQ="'"
>
> Define a common $SQ variable in test-lib.sh and replace all usages of
> these bespoke variables with the common one.
>
> This change was done by running `git grep =\"\'\" t/` and
> `git grep =\\\\\'` and manually changing the resulting definitions and
> corresponding usages.
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
>
> [whoops, forgot to include the mailing list in the last email]
>
> Sorry, I wrote this patch up before I saw the email about leaving this
> as #leftoverbits. No point in letting it go to waste, though.

Thanks for doing this. I marked it as '#leftoverbits' in case anybody
hosting an Outreachy intern might be interested in having something
small for a newcomer to dip their toes into sending to the mailing list.

But, there's no shortage of other such tasks, I'd assume, so it's good
that you cleaned these up.

Both of your 'git grep' invocations look correct to me, so the patch
below looks like an obviously-correct result. Thanks.

-Taylor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use common $SQ variable
  2019-09-05 22:25           ` Taylor Blau
@ 2019-09-05 22:27             ` Taylor Blau
  0 siblings, 0 replies; 10+ messages in thread
From: Taylor Blau @ 2019-09-05 22:27 UTC (permalink / raw)
  To: Taylor Blau; +Cc: Denton Liu, Git Mailing List, Junio C Hamano, Jeff King

On Thu, Sep 05, 2019 at 06:25:26PM -0400, Taylor Blau wrote:
> On Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:
> > In many test scripts, there are bespoke definitions of the single quote
> > that are some variation of this:
> >
> >     SQ="'"
> >
> > Define a common $SQ variable in test-lib.sh and replace all usages of
> > these bespoke variables with the common one.
> >
> > This change was done by running `git grep =\"\'\" t/` and
> > `git grep =\\\\\'` and manually changing the resulting definitions and
> > corresponding usages.
> > Signed-off-by: Denton Liu <liu.denton@gmail.com>
> > ---
> >
> > [whoops, forgot to include the mailing list in the last email]
> >
> > Sorry, I wrote this patch up before I saw the email about leaving this
> > as #leftoverbits. No point in letting it go to waste, though.
>
> Thanks for doing this. I marked it as '#leftoverbits' in case anybody
> hosting an Outreachy intern might be interested in having something
> small for a newcomer to dip their toes into sending to the mailing list.

Oh, how silly of me. I was thinking about [1], which I said would be
good #leftoverbits material. This thread was tagged by Junio, not me.
The rest of my point stands, though ;).

> But, there's no shortage of other such tasks, I'd assume, so it's good
> that you cleaned these up.
>
> Both of your 'git grep' invocations look correct to me, so the patch
> below looks like an obviously-correct result. Thanks.
>
> -Taylor
Thanks,
Taylor

[1]: https://public-inbox.org/git/20190904212121.GB20904@syl.local/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] t: use common $SQ variable
  2019-09-05 22:10         ` [PATCH] t: use common $SQ variable Denton Liu
  2019-09-05 22:25           ` Taylor Blau
@ 2019-09-06  2:04           ` Denton Liu
  1 sibling, 0 replies; 10+ messages in thread
From: Denton Liu @ 2019-09-06  2:04 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Jeff King, Taylor Blau

I should've noted earlier that this patch applies cleanly on top of the
"jc/tests-use-lf-from-test-lib" branch.

On Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:
> In many test scripts, there are bespoke definitions of the single quote
> that are some variation of this:
> 
>     SQ="'"
> 
> Define a common $SQ variable in test-lib.sh and replace all usages of
> these bespoke variables with the common one.
> 
> This change was done by running `git grep =\"\'\" t/` and
> `git grep =\\\\\'` and manually changing the resulting definitions and

Oops, this invocation wasn't exactly correct; it's missing the `t/` at
the end. The full invocation should read `git grep =\\\\\' t/`.

> corresponding usages.
> 
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> 
> [whoops, forgot to include the mailing list in the last email]
> 
> Sorry, I wrote this patch up before I saw the email about leaving this
> as #leftoverbits. No point in letting it go to waste, though.
> 
>  t/t1300-config.sh              |  9 +++--
>  t/t1404-update-ref-errors.sh   | 64 ++++++++++++++++------------------
>  t/t1414-reflog-walk.sh         |  3 +-
>  t/t1506-rev-parse-diagnosis.sh |  5 ++-
>  t/t1507-rev-parse-upstream.sh  | 12 +++----
>  t/t3005-ls-files-relative.sh   |  9 +++--
>  t/t3404-rebase-interactive.sh  |  1 -
>  t/t3430-rebase-merges.sh       |  1 -
>  t/t5601-clone.sh               |  1 -
>  t/t7406-submodule-update.sh    |  3 +-
>  t/test-lib.sh                  |  3 ++
>  11 files changed, 51 insertions(+), 60 deletions(-)
> 
> diff --git a/t/t1300-config.sh b/t/t1300-config.sh
> index 428177c390..983a0a1583 100755
> --- a/t/t1300-config.sh
> +++ b/t/t1300-config.sh
> @@ -1294,26 +1294,25 @@ test_expect_success 'git -c is not confused by empty environment' '
>  	GIT_CONFIG_PARAMETERS="" git -c x.one=1 config --list
>  '
>  
> -sq="'"
>  test_expect_success 'detect bogus GIT_CONFIG_PARAMETERS' '
>  	cat >expect <<-\EOF &&
>  	env.one one
>  	env.two two
>  	EOF
> -	GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq} ${sq}env.two=two${sq}" \
> +	GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ} ${SQ}env.two=two${SQ}" \
>  		git config --get-regexp "env.*" >actual &&
>  	test_cmp expect actual &&
>  
>  	cat >expect <<-EOF &&
> -	env.one one${sq}
> +	env.one one${SQ}
>  	env.two two
>  	EOF
> -	GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq}\\$sq$sq$sq ${sq}env.two=two${sq}" \
> +	GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ}\\$SQ$SQ$SQ ${SQ}env.two=two${SQ}" \
>  		git config --get-regexp "env.*" >actual &&
>  	test_cmp expect actual &&
>  
>  	test_must_fail env \
> -		GIT_CONFIG_PARAMETERS="${sq}env.one=one${sq}\\$sq ${sq}env.two=two${sq}" \
> +		GIT_CONFIG_PARAMETERS="${SQ}env.one=one${SQ}\\$SQ ${SQ}env.two=two${SQ}" \
>  		git config --get-regexp "env.*"
>  '
>  
> diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
> index 970c5c36b9..2d142e5535 100755
> --- a/t/t1404-update-ref-errors.sh
> +++ b/t/t1404-update-ref-errors.sh
> @@ -32,8 +32,6 @@ test_update_rejected () {
>  	test_cmp unchanged actual
>  }
>  
> -Q="'"
> -
>  # Test adding and deleting D/F-conflicting references in a single
>  # transaction.
>  df_test() {
> @@ -93,7 +91,7 @@ df_test() {
>  		delname="$delref"
>  	fi &&
>  	cat >expected-err <<-EOF &&
> -	fatal: cannot lock ref $Q$addname$Q: $Q$delref$Q exists; cannot create $Q$addref$Q
> +	fatal: cannot lock ref $SQ$addname$SQ: $SQ$delref$SQ exists; cannot create $SQ$addref$SQ
>  	EOF
>  	$pack &&
>  	if $add_del
> @@ -123,7 +121,7 @@ test_expect_success 'existing loose ref is a simple prefix of new' '
>  
>  	prefix=refs/1l &&
>  	test_update_rejected "a c e" false "b c/x d" \
> -		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"
> +		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ"
>  
>  '
>  
> @@ -131,7 +129,7 @@ test_expect_success 'existing packed ref is a simple prefix of new' '
>  
>  	prefix=refs/1p &&
>  	test_update_rejected "a c e" true "b c/x d" \
> -		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q"
> +		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ"
>  
>  '
>  
> @@ -139,7 +137,7 @@ test_expect_success 'existing loose ref is a deeper prefix of new' '
>  
>  	prefix=refs/2l &&
>  	test_update_rejected "a c e" false "b c/x/y d" \
> -		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"
> +		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ"
>  
>  '
>  
> @@ -147,7 +145,7 @@ test_expect_success 'existing packed ref is a deeper prefix of new' '
>  
>  	prefix=refs/2p &&
>  	test_update_rejected "a c e" true "b c/x/y d" \
> -		"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q"
> +		"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ"
>  
>  '
>  
> @@ -155,7 +153,7 @@ test_expect_success 'new ref is a simple prefix of existing loose' '
>  
>  	prefix=refs/3l &&
>  	test_update_rejected "a c/x e" false "b c d" \
> -		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"
> +		"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ"
>  
>  '
>  
> @@ -163,7 +161,7 @@ test_expect_success 'new ref is a simple prefix of existing packed' '
>  
>  	prefix=refs/3p &&
>  	test_update_rejected "a c/x e" true "b c d" \
> -		"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q"
> +		"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ"
>  
>  '
>  
> @@ -171,7 +169,7 @@ test_expect_success 'new ref is a deeper prefix of existing loose' '
>  
>  	prefix=refs/4l &&
>  	test_update_rejected "a c/x/y e" false "b c d" \
> -		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"
> +		"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ"
>  
>  '
>  
> @@ -179,7 +177,7 @@ test_expect_success 'new ref is a deeper prefix of existing packed' '
>  
>  	prefix=refs/4p &&
>  	test_update_rejected "a c/x/y e" true "b c d" \
> -		"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q"
> +		"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ"
>  
>  '
>  
> @@ -187,7 +185,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
>  
>  	prefix=refs/5 &&
>  	test_update_rejected "a e" false "b c c/x d" \
> -		"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time"
> +		"cannot process $SQ$prefix/c$SQ and $SQ$prefix/c/x$SQ at the same time"
>  
>  '
>  
> @@ -334,7 +332,7 @@ test_expect_success 'D/F conflict prevents indirect delete long packed + indirec
>  test_expect_success 'missing old value blocks update' '
>  	prefix=refs/missing-update &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/foo $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -345,7 +343,7 @@ test_expect_success 'incorrect old value blocks update' '
>  	prefix=refs/incorrect-update &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "update $prefix/foo $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -356,7 +354,7 @@ test_expect_success 'existing old value blocks create' '
>  	prefix=refs/existing-create &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: reference already exists
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: reference already exists
>  	EOF
>  	printf "%s\n" "create $prefix/foo $E" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -367,7 +365,7 @@ test_expect_success 'incorrect old value blocks delete' '
>  	prefix=refs/incorrect-delete &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "delete $prefix/foo $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -378,7 +376,7 @@ test_expect_success 'missing old value blocks indirect update' '
>  	prefix=refs/missing-indirect-update &&
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/symref $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -390,7 +388,7 @@ test_expect_success 'incorrect old value blocks indirect update' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "update $prefix/symref $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -402,7 +400,7 @@ test_expect_success 'existing old value blocks indirect create' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: reference already exists
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists
>  	EOF
>  	printf "%s\n" "create $prefix/symref $E" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -414,7 +412,7 @@ test_expect_success 'incorrect old value blocks indirect delete' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "delete $prefix/symref $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -425,7 +423,7 @@ test_expect_success 'missing old value blocks indirect no-deref update' '
>  	prefix=refs/missing-noderef-update &&
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: reference is missing but expected $D
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference is missing but expected $D
>  	EOF
>  	printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -437,7 +435,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -449,7 +447,7 @@ test_expect_success 'existing old value blocks indirect no-deref create' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: reference already exists
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists
>  	EOF
>  	printf "%s\n" "option no-deref" "create $prefix/symref $E" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -461,7 +459,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	git update-ref $prefix/foo $C &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D
>  	EOF
>  	printf "%s\n" "option no-deref" "delete $prefix/symref $D" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -474,13 +472,13 @@ test_expect_success 'non-empty directory blocks create' '
>  	: >.git/$prefix/foo/bar/baz.lock &&
>  	test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/foo $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
>  	test_cmp expected output.err &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/foo $D $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -493,13 +491,13 @@ test_expect_success 'broken reference blocks create' '
>  	echo "gobbledigook" >.git/$prefix/foo &&
>  	test_when_finished "rm -f .git/$prefix/foo" &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
>  	EOF
>  	printf "%s\n" "update $prefix/foo $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
>  	test_cmp expected output.err &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
> +	fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
>  	EOF
>  	printf "%s\n" "update $prefix/foo $D $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -513,13 +511,13 @@ test_expect_success 'non-empty directory blocks indirect create' '
>  	: >.git/$prefix/foo/bar/baz.lock &&
>  	test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/symref $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
>  	test_cmp expected output.err &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ
>  	EOF
>  	printf "%s\n" "update $prefix/symref $D $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -532,13 +530,13 @@ test_expect_success 'broken reference blocks indirect create' '
>  	echo "gobbledigook" >.git/$prefix/foo &&
>  	test_when_finished "rm -f .git/$prefix/foo" &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
>  	EOF
>  	printf "%s\n" "update $prefix/symref $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
>  	test_cmp expected output.err &&
>  	cat >expected <<-EOF &&
> -	fatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken
> +	fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken
>  	EOF
>  	printf "%s\n" "update $prefix/symref $D $C" |
>  	test_must_fail git update-ref --stdin 2>output.err &&
> @@ -614,7 +612,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
>  	test_when_finished "rm -f .git/packed-refs.lock" &&
>  	test_must_fail git update-ref -d $prefix/foo >out 2>err &&
>  	git for-each-ref $prefix >actual &&
> -	test_i18ngrep "Unable to create $Q.*packed-refs.lock$Q: " err &&
> +	test_i18ngrep "Unable to create $SQ.*packed-refs.lock$SQ: " err &&
>  	test_cmp unchanged actual
>  '
>  
> diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
> index feb1efd8ff..1181a9fb28 100755
> --- a/t/t1414-reflog-walk.sh
> +++ b/t/t1414-reflog-walk.sh
> @@ -18,10 +18,9 @@ do_walk () {
>  	git log -g --format="%gd %gs" "$@"
>  }
>  
> -sq="'"
>  test_expect_success 'set up expected reflog' '
>  	cat >expect.all <<-EOF
> -	HEAD@{0} commit (merge): Merge branch ${sq}master${sq} into side
> +	HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side
>  	HEAD@{1} commit: three
>  	HEAD@{2} checkout: moving from master to side
>  	HEAD@{3} commit: two
> diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
> index 4ee009da66..21a9c8ffb2 100755
> --- a/t/t1506-rev-parse-diagnosis.sh
> +++ b/t/t1506-rev-parse-diagnosis.sh
> @@ -8,10 +8,9 @@ exec </dev/null
>  
>  test_did_you_mean ()
>  {
> -	sq="'" &&
>  	cat >expected <<-EOF &&
> -	fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
> -	Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
> +	fatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.
> +	Did you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?
>  	EOF
>  	test_cmp expected error
>  }
> diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh
> index fa3e499641..8b4cf8a6e3 100755
> --- a/t/t1507-rev-parse-upstream.sh
> +++ b/t/t1507-rev-parse-upstream.sh
> @@ -28,8 +28,6 @@ test_expect_success 'setup' '
>  	)
>  '
>  
> -sq="'"
> -
>  full_name () {
>  	(cd clone &&
>  	 git rev-parse --symbolic-full-name "$@")
> @@ -129,7 +127,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '
>  	git branch -t new my-side@{u} &&
>  	git merge -s ours new@{u} &&
>  	git show -s --pretty=tformat:%s >actual &&
> -	echo "Merge remote-tracking branch ${sq}origin/side${sq}" >expect &&
> +	echo "Merge remote-tracking branch ${SQ}origin/side${SQ}" >expect &&
>  	test_cmp expect actual
>  )
>  '
> @@ -156,7 +154,7 @@ test_expect_success 'branch@{u} works when tracking a local branch' '
>  
>  test_expect_success 'branch@{u} error message when no upstream' '
>  	cat >expect <<-EOF &&
> -	fatal: no upstream configured for branch ${sq}non-tracking${sq}
> +	fatal: no upstream configured for branch ${SQ}non-tracking${SQ}
>  	EOF
>  	error_message non-tracking@{u} &&
>  	test_i18ncmp expect error
> @@ -164,7 +162,7 @@ test_expect_success 'branch@{u} error message when no upstream' '
>  
>  test_expect_success '@{u} error message when no upstream' '
>  	cat >expect <<-EOF &&
> -	fatal: no upstream configured for branch ${sq}master${sq}
> +	fatal: no upstream configured for branch ${SQ}master${SQ}
>  	EOF
>  	test_must_fail git rev-parse --verify @{u} 2>actual &&
>  	test_i18ncmp expect actual
> @@ -172,7 +170,7 @@ test_expect_success '@{u} error message when no upstream' '
>  
>  test_expect_success 'branch@{u} error message with misspelt branch' '
>  	cat >expect <<-EOF &&
> -	fatal: no such branch: ${sq}no-such-branch${sq}
> +	fatal: no such branch: ${SQ}no-such-branch${SQ}
>  	EOF
>  	error_message no-such-branch@{u} &&
>  	test_i18ncmp expect error
> @@ -189,7 +187,7 @@ test_expect_success '@{u} error message when not on a branch' '
>  
>  test_expect_success 'branch@{u} error message if upstream branch not fetched' '
>  	cat >expect <<-EOF &&
> -	fatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch
> +	fatal: upstream branch ${SQ}refs/heads/side${SQ} not stored as a remote-tracking branch
>  	EOF
>  	error_message bad-upstream@{u} &&
>  	test_i18ncmp expect error
> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
> index 209b4c7cd8..c841f9b454 100755
> --- a/t/t3005-ls-files-relative.sh
> +++ b/t/t3005-ls-files-relative.sh
> @@ -9,7 +9,6 @@ This test runs git ls-files with various relative path arguments.
>  
>  new_line='
>  '
> -sq=\'
>  
>  test_expect_success 'prepare' '
>  	: >never-mind-me &&
> @@ -44,9 +43,9 @@ test_expect_success 'ls-files -c' '
>  		cd top/sub &&
>  		for f in ../y*
>  		do
> -			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
> +			echo "error: pathspec $SQ$f$SQ did not match any file(s) known to git"
>  		done >expect.err &&
> -		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
> +		echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
>  		ls ../x* >expect.out &&
>  		test_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&
>  		test_cmp expect.out actual.out &&
> @@ -59,9 +58,9 @@ test_expect_success 'ls-files -o' '
>  		cd top/sub &&
>  		for f in ../x*
>  		do
> -			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
> +			echo "error: pathspec $SQ$f$SQ did not match any file(s) known to git"
>  		done >expect.err &&
> -		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
> +		echo "Did you forget to ${SQ}git add${SQ}?" >>expect.err &&
>  		ls ../y* >expect.out &&
>  		test_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&
>  		test_cmp expect.out actual.out &&
> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
> index 461dd539ff..9c152b6245 100755
> --- a/t/t3404-rebase-interactive.sh
> +++ b/t/t3404-rebase-interactive.sh
> @@ -1419,7 +1419,6 @@ test_expect_success 'editor saves as CR/LF' '
>  	)
>  '
>  
> -SQ="'"
>  test_expect_success 'rebase -i --gpg-sign=<key-id>' '
>  	test_when_finished "test_might_fail git rebase --abort" &&
>  	set_fake_editor &&
> diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
> index 7b6c4847ad..11141ac864 100755
> --- a/t/t3430-rebase-merges.sh
> +++ b/t/t3430-rebase-merges.sh
> @@ -151,7 +151,6 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '
>  	test_path_is_file .git/rebase-merge/patch
>  '
>  
> -SQ="'"
>  test_expect_success 'failed `merge <branch>` does not crash' '
>  	test_when_finished "test_might_fail git rebase --abort" &&
>  	git checkout conflicting-G &&
> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> index 4a3b901f06..3be025a658 100755
> --- a/t/t5601-clone.sh
> +++ b/t/t5601-clone.sh
> @@ -434,7 +434,6 @@ test_expect_success 'double quoted plink.exe in GIT_SSH_COMMAND' '
>  	expect_ssh "-v -P 123" myhost src
>  '
>  
> -SQ="'"
>  test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' '
>  	copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" &&
>  	GIT_SSH_COMMAND="$SQ$TRASH_DIRECTORY/plink.exe$SQ -v" \
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index c973278300..df34c994d2 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -158,7 +158,6 @@ test_expect_success 'submodule update --init from and of subdirectory' '
>  	test_i18ncmp expect2 actual2
>  '
>  
> -apos="'";
>  test_expect_success 'submodule update does not fetch already present commits' '
>  	(cd submodule &&
>  	  echo line3 >> file &&
> @@ -168,7 +167,7 @@ test_expect_success 'submodule update does not fetch already present commits' '
>  	) &&
>  	(cd super/submodule &&
>  	  head=$(git rev-parse --verify HEAD) &&
> -	  echo "Submodule path ${apos}submodule$apos: checked out $apos$head$apos" > ../../expected &&
> +	  echo "Submodule path ${SQ}submodule$SQ: checked out $SQ$head$SQ" > ../../expected &&
>  	  git reset --hard HEAD~1
>  	) &&
>  	(cd super &&
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index a9d45642a5..ee602c4d9c 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -509,6 +509,9 @@ EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>  LF='
>  '
>  
> +# Single quote
> +SQ=\'
> +
>  # UTF-8 ZERO WIDTH NON-JOINER, which HFS+ ignores
>  # when case-folding filenames
>  u200c=$(printf '\342\200\214')
> -- 
> 2.23.0.37.g745f681289
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-09-06  2:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 21:11 [PATCH] t: use LF variable defined in the test harness Junio C Hamano
2019-09-04  0:29 ` Taylor Blau
2019-09-05 18:17   ` Junio C Hamano
2019-09-05 18:47     ` Jeff King
2019-09-05 19:34       ` Junio C Hamano
2019-09-05 22:10         ` [PATCH] t: use common $SQ variable Denton Liu
2019-09-05 22:25           ` Taylor Blau
2019-09-05 22:27             ` Taylor Blau
2019-09-06  2:04           ` Denton Liu
2019-09-05 18:52     ` [PATCH] t: use LF variable defined in the test harness Taylor Blau

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).