{"thread":{"id":"51797","subject":"[PATCH] t: use LF variable defined in the test harness","startedAt":"2019-09-03T21:11:29Z","lastAt":"2019-09-06T02:05:00Z","messageCount":10,"participants":["Junio C Hamano","Taylor Blau","Jeff King","Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"381768","messageId":"xmqqwoeprsp1.fsf@gitster-ct.c.googlers.com","threadId":"51797","inReplyTo":null,"subject":"[PATCH] t: use LF variable defined in the test harness","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-09-03T21:11:22Z","receivedAt":"2019-09-03T21:11:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"A few test scripts assign a single LF to $LF, but that is already\ngiven by test-lib.sh to everybody.\n\nRemove the unnecessary reassignment.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t3404-rebase-interactive.sh | 2 --\n t/t4013-diff-various.sh       | 3 ---\n t/t5515-fetch-merge-logic.sh  | 3 ---\n 3 files changed, 8 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 461dd539ff..31114d0bbb 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -155,8 +155,6 @@ test_expect_success 'rebase -x with empty command fails' '\n \ttest_i18ncmp expected actual\n '\n \n-LF='\n-'\n test_expect_success 'rebase -x with newline in command fails' '\n \ttest_when_finished \"git rebase --abort ||:\" &&\n \ttest_must_fail env git rebase -x \"a${LF}b\" @ 2>actual &&\ndiff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\nindex a9054d2db1..5ac94b390d 100755\n--- a/t/t4013-diff-various.sh\n+++ b/t/t4013-diff-various.sh\n@@ -7,9 +7,6 @@ test_description='Various diff formatting options'\n \n . ./test-lib.sh\n \n-LF='\n-'\n-\n test_expect_success setup '\n \n \tGIT_AUTHOR_DATE=\"2006-06-26 00:00:00 +0000\" &&\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex e55d8474ef..961eb35c99 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -12,9 +12,6 @@ GIT_TEST_PROTOCOL_VERSION=\n \n . ./test-lib.sh\n \n-LF='\n-'\n-\n test_expect_success setup '\n \tGIT_AUTHOR_DATE=\"2006-06-26 00:00:00 +0000\" &&\n \tGIT_COMMITTER_DATE=\"2006-06-26 00:00:00 +0000\" &&\n"},{"id":"381780","messageId":"20190904002930.GA76383@syl.lan","threadId":"51797","inReplyTo":"xmqqwoeprsp1.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] t: use LF variable defined in the test harness","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2019-09-04T00:29:30Z","receivedAt":"2019-09-04T00:29:35Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"Hi Junio,\n\nOn Tue, Sep 03, 2019 at 02:11:22PM -0700, Junio C Hamano wrote:\n> A few test scripts assign a single LF to $LF, but that is already\n> given by test-lib.sh to everybody.\n\nI didn't know that 't/test-lib.sh' provided '$LF' (as I'm sure was the\ncase for the respective authors of those tests below ;-)), so removing\nthe bespoke definitions and relying on the one already defined makes\ngood sense.\n\n> Remove the unnecessary reassignment.\n\nI did find a couple of extra spots when I went looking through 't'\nmyself. I ran:\n\n  $ git grep \"='$\" -- t\n\nwhich in addition to the three spots below turned up a couple more\ninteresting locations, as well as a few false positives. They are:\n\n  - t/t3005: this script calls the variable '$new_line', but could be\n    renamed to LF and then removed in a second patch\n\n  - t/valgrind/analyze.sh: this script also calls the variable\n    '$new_line', but does not ever source test-lib.sh, so I think this\n    spot can be ignored.\n\nSo I think that my recommendation is to either:\n\n  * introduce a prepratory patch that updates t3005 to rename\n    '$new_line' to '$LF', and then amend the patch below to also blow\n    away t3005's use of '$LF', or\n\n  * do both steps in one larger patch\n\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/t3404-rebase-interactive.sh | 2 --\n>  t/t4013-diff-various.sh       | 3 ---\n>  t/t5515-fetch-merge-logic.sh  | 3 ---\n>  3 files changed, 8 deletions(-)\n>\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 461dd539ff..31114d0bbb 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -155,8 +155,6 @@ test_expect_success 'rebase -x with empty command fails' '\n>  \ttest_i18ncmp expected actual\n>  '\n>\n> -LF='\n> -'\n>  test_expect_success 'rebase -x with newline in command fails' '\n>  \ttest_when_finished \"git rebase --abort ||:\" &&\n>  \ttest_must_fail env git rebase -x \"a${LF}b\" @ 2>actual &&\n> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh\n> index a9054d2db1..5ac94b390d 100755\n> --- a/t/t4013-diff-various.sh\n> +++ b/t/t4013-diff-various.sh\n> @@ -7,9 +7,6 @@ test_description='Various diff formatting options'\n>\n>  . ./test-lib.sh\n>\n> -LF='\n> -'\n> -\n>  test_expect_success setup '\n>\n>  \tGIT_AUTHOR_DATE=\"2006-06-26 00:00:00 +0000\" &&\n> diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\n> index e55d8474ef..961eb35c99 100755\n> --- a/t/t5515-fetch-merge-logic.sh\n> +++ b/t/t5515-fetch-merge-logic.sh\n> @@ -12,9 +12,6 @@ GIT_TEST_PROTOCOL_VERSION=\n>\n>  . ./test-lib.sh\n>\n> -LF='\n> -'\n> -\n>  test_expect_success setup '\n>  \tGIT_AUTHOR_DATE=\"2006-06-26 00:00:00 +0000\" &&\n>  \tGIT_COMMITTER_DATE=\"2006-06-26 00:00:00 +0000\" &&\n\nThe rest of the patch here looks obviously good.\n\nThanks,\nTaylor\n"},{"id":"381892","messageId":"xmqq7e6mr4iy.fsf@gitster-ct.c.googlers.com","threadId":"51797","inReplyTo":"20190904002930.GA76383@syl.lan","subject":"Re: [PATCH] t: use LF variable defined in the test harness","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-09-05T18:17:57Z","receivedAt":"2019-09-05T18:18:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n>   - t/t3005: this script calls the variable '$new_line', but could be\n>     renamed to LF and then removed in a second patch\n\nIt is worse than that, isn't it?\n\nIf it used $new_line, then it would probably have been a good idea\nto somehow make a separate patch related to this one and make a\nseries about \"use $LF from test-lib\", but ever since its beginning\nat 0f64bfa9 (\"ls-files: fix pathspec display on error\", 2011-08-01),\n$new_line is assigned once but never used in the script.\n\nSomebody may want to go clean-up the use of various $sq and $SQ\nlocally defined by giving a unified $SQ in test-lib.sh, by the way.\n\n-- >8 --\nSubject: t3005: remove unused variable\n\nSince the beginning of the script, $new_line variable was never used.\nRemove it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t3005-ls-files-relative.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\nindex 209b4c7cd8..583e467683 100755\n--- a/t/t3005-ls-files-relative.sh\n+++ b/t/t3005-ls-files-relative.sh\n@@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.\n \n . ./test-lib.sh\n \n-new_line='\n-'\n sq=\\'\n \n test_expect_success 'prepare' '\n"},{"id":"381895","messageId":"20190905184716.GA12647@sigill.intra.peff.net","threadId":"51797","inReplyTo":"xmqq7e6mr4iy.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] t: use LF variable defined in the test harness","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-09-05T18:47:16Z","receivedAt":"2019-09-05T18:47:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:\n\n> Somebody may want to go clean-up the use of various $sq and $SQ\n> locally defined by giving a unified $SQ in test-lib.sh, by the way.\n\nMaybe good #leftoverbits material, since we may have Outreachy\napplications coming up soon.\n\n-Peff\n"},{"id":"381896","messageId":"20190905185243.GA50575@syl.local","threadId":"51797","inReplyTo":"xmqq7e6mr4iy.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] t: use LF variable defined in the test harness","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2019-09-05T18:52:43Z","receivedAt":"2019-09-05T18:52:46Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:\n> Taylor Blau <me@ttaylorr.com> writes:\n>\n> >   - t/t3005: this script calls the variable '$new_line', but could be\n> >     renamed to LF and then removed in a second patch\n>\n> It is worse than that, isn't it?\n>\n> If it used $new_line, then it would probably have been a good idea\n> to somehow make a separate patch related to this one and make a\n> series about \"use $LF from test-lib\", but ever since its beginning\n> at 0f64bfa9 (\"ls-files: fix pathspec display on error\", 2011-08-01),\n> $new_line is assigned once but never used in the script.\n\nAh, thanks for catching it ;-). I think the patch below the scissors is\ntotally right; there's obviously no need for a preparatory patch here\nother than the one you provided.\n\n> Somebody may want to go clean-up the use of various $sq and $SQ\n> locally defined by giving a unified $SQ in test-lib.sh, by the way.\n>\n> -- >8 --\n> Subject: t3005: remove unused variable\n>\n> Since the beginning of the script, $new_line variable was never used.\n> Remove it.\n>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/t3005-ls-files-relative.sh | 2 --\n>  1 file changed, 2 deletions(-)\n>\n> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\n> index 209b4c7cd8..583e467683 100755\n> --- a/t/t3005-ls-files-relative.sh\n> +++ b/t/t3005-ls-files-relative.sh\n> @@ -7,8 +7,6 @@ This test runs git ls-files with various relative path arguments.\n>\n>  . ./test-lib.sh\n>\n> -new_line='\n> -'\n>  sq=\\'\n>\n>  test_expect_success 'prepare' '\n\nThanks,\nTaylor\n"},{"id":"381903","messageId":"xmqqmufipmfp.fsf@gitster-ct.c.googlers.com","threadId":"51797","inReplyTo":"20190905184716.GA12647@sigill.intra.peff.net","subject":"Re: [PATCH] t: use LF variable defined in the test harness","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-09-05T19:34:02Z","receivedAt":"2019-09-05T19:34:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Sep 05, 2019 at 11:17:57AM -0700, Junio C Hamano wrote:\n>\n>> Somebody may want to go clean-up the use of various $sq and $SQ\n>> locally defined by giving a unified $SQ in test-lib.sh, by the way.\n>\n> Maybe good #leftoverbits material, since we may have Outreachy\n> applications coming up soon.\n\nOK, then I'd refrain from doing it as a lunchtime hack myself ;-)\n\n * Find sq=, $sq and ${sq} case insensitively in t/.  If there is\n   any use of $SQ that does not want a single quote in it, abort\n   the whole thing.  Otherwise proceed.\n\n * Introduce an assignment SQ=\\' in t/test-lib.sh, next to where LF\n   is assigned to.  Replace all uses you found in #1 with reference\n   to $SQ.\n\n#leftoverbits.\n"},{"id":"381924","messageId":"0598bbf4d0b2cb07ff6f06f904cbdd3f5a3ae1af.1567721303.git.liu.denton@gmail.com","threadId":"51797","inReplyTo":"xmqqmufipmfp.fsf@gitster-ct.c.googlers.com","subject":"[PATCH] t: use common $SQ variable","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-09-05T22:10:05Z","receivedAt":"2019-09-05T22:10:10Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"In many test scripts, there are bespoke definitions of the single quote\nthat are some variation of this:\n\n    SQ=\"'\"\n\nDefine a common $SQ variable in test-lib.sh and replace all usages of\nthese bespoke variables with the common one.\n\nThis change was done by running `git grep =\\\"\\'\\\" t/` and\n`git grep =\\\\\\\\\\'` and manually changing the resulting definitions and\ncorresponding usages.\n\nSigned-off-by: Denton Liu <liu.denton@gmail.com>\n---\n\n[whoops, forgot to include the mailing list in the last email]\n\nSorry, I wrote this patch up before I saw the email about leaving this\nas #leftoverbits. No point in letting it go to waste, though.\n\n t/t1300-config.sh              |  9 +++--\n t/t1404-update-ref-errors.sh   | 64 ++++++++++++++++------------------\n t/t1414-reflog-walk.sh         |  3 +-\n t/t1506-rev-parse-diagnosis.sh |  5 ++-\n t/t1507-rev-parse-upstream.sh  | 12 +++----\n t/t3005-ls-files-relative.sh   |  9 +++--\n t/t3404-rebase-interactive.sh  |  1 -\n t/t3430-rebase-merges.sh       |  1 -\n t/t5601-clone.sh               |  1 -\n t/t7406-submodule-update.sh    |  3 +-\n t/test-lib.sh                  |  3 ++\n 11 files changed, 51 insertions(+), 60 deletions(-)\n\ndiff --git a/t/t1300-config.sh b/t/t1300-config.sh\nindex 428177c390..983a0a1583 100755\n--- a/t/t1300-config.sh\n+++ b/t/t1300-config.sh\n@@ -1294,26 +1294,25 @@ test_expect_success 'git -c is not confused by empty environment' '\n \tGIT_CONFIG_PARAMETERS=\"\" git -c x.one=1 config --list\n '\n \n-sq=\"'\"\n test_expect_success 'detect bogus GIT_CONFIG_PARAMETERS' '\n \tcat >expect <<-\\EOF &&\n \tenv.one one\n \tenv.two two\n \tEOF\n-\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq} ${sq}env.two=two${sq}\" \\\n+\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ} ${SQ}env.two=two${SQ}\" \\\n \t\tgit config --get-regexp \"env.*\" >actual &&\n \ttest_cmp expect actual &&\n \n \tcat >expect <<-EOF &&\n-\tenv.one one${sq}\n+\tenv.one one${SQ}\n \tenv.two two\n \tEOF\n-\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq}\\\\$sq$sq$sq ${sq}env.two=two${sq}\" \\\n+\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ}\\\\$SQ$SQ$SQ ${SQ}env.two=two${SQ}\" \\\n \t\tgit config --get-regexp \"env.*\" >actual &&\n \ttest_cmp expect actual &&\n \n \ttest_must_fail env \\\n-\t\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq}\\\\$sq ${sq}env.two=two${sq}\" \\\n+\t\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ}\\\\$SQ ${SQ}env.two=two${SQ}\" \\\n \t\tgit config --get-regexp \"env.*\"\n '\n \ndiff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\nindex 970c5c36b9..2d142e5535 100755\n--- a/t/t1404-update-ref-errors.sh\n+++ b/t/t1404-update-ref-errors.sh\n@@ -32,8 +32,6 @@ test_update_rejected () {\n \ttest_cmp unchanged actual\n }\n \n-Q=\"'\"\n-\n # Test adding and deleting D/F-conflicting references in a single\n # transaction.\n df_test() {\n@@ -93,7 +91,7 @@ df_test() {\n \t\tdelname=\"$delref\"\n \tfi &&\n \tcat >expected-err <<-EOF &&\n-\tfatal: cannot lock ref $Q$addname$Q: $Q$delref$Q exists; cannot create $Q$addref$Q\n+\tfatal: cannot lock ref $SQ$addname$SQ: $SQ$delref$SQ exists; cannot create $SQ$addref$SQ\n \tEOF\n \t$pack &&\n \tif $add_del\n@@ -123,7 +121,7 @@ test_expect_success 'existing loose ref is a simple prefix of new' '\n \n \tprefix=refs/1l &&\n \ttest_update_rejected \"a c e\" false \"b c/x d\" \\\n-\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q\"\n+\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ\"\n \n '\n \n@@ -131,7 +129,7 @@ test_expect_success 'existing packed ref is a simple prefix of new' '\n \n \tprefix=refs/1p &&\n \ttest_update_rejected \"a c e\" true \"b c/x d\" \\\n-\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q\"\n+\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ\"\n \n '\n \n@@ -139,7 +137,7 @@ test_expect_success 'existing loose ref is a deeper prefix of new' '\n \n \tprefix=refs/2l &&\n \ttest_update_rejected \"a c e\" false \"b c/x/y d\" \\\n-\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q\"\n+\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ\"\n \n '\n \n@@ -147,7 +145,7 @@ test_expect_success 'existing packed ref is a deeper prefix of new' '\n \n \tprefix=refs/2p &&\n \ttest_update_rejected \"a c e\" true \"b c/x/y d\" \\\n-\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q\"\n+\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ\"\n \n '\n \n@@ -155,7 +153,7 @@ test_expect_success 'new ref is a simple prefix of existing loose' '\n \n \tprefix=refs/3l &&\n \ttest_update_rejected \"a c/x e\" false \"b c d\" \\\n-\t\t\"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q\"\n+\t\t\"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ\"\n \n '\n \n@@ -163,7 +161,7 @@ test_expect_success 'new ref is a simple prefix of existing packed' '\n \n \tprefix=refs/3p &&\n \ttest_update_rejected \"a c/x e\" true \"b c d\" \\\n-\t\t\"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q\"\n+\t\t\"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ\"\n \n '\n \n@@ -171,7 +169,7 @@ test_expect_success 'new ref is a deeper prefix of existing loose' '\n \n \tprefix=refs/4l &&\n \ttest_update_rejected \"a c/x/y e\" false \"b c d\" \\\n-\t\t\"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q\"\n+\t\t\"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ\"\n \n '\n \n@@ -179,7 +177,7 @@ test_expect_success 'new ref is a deeper prefix of existing packed' '\n \n \tprefix=refs/4p &&\n \ttest_update_rejected \"a c/x/y e\" true \"b c d\" \\\n-\t\t\"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q\"\n+\t\t\"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ\"\n \n '\n \n@@ -187,7 +185,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n \n \tprefix=refs/5 &&\n \ttest_update_rejected \"a e\" false \"b c c/x d\" \\\n-\t\t\"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time\"\n+\t\t\"cannot process $SQ$prefix/c$SQ and $SQ$prefix/c/x$SQ at the same time\"\n \n '\n \n@@ -334,7 +332,7 @@ test_expect_success 'D/F conflict prevents indirect delete long packed + indirec\n test_expect_success 'missing old value blocks update' '\n \tprefix=refs/missing-update &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -345,7 +343,7 @@ test_expect_success 'incorrect old value blocks update' '\n \tprefix=refs/incorrect-update &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -356,7 +354,7 @@ test_expect_success 'existing old value blocks create' '\n \tprefix=refs/existing-create &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: reference already exists\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: reference already exists\n \tEOF\n \tprintf \"%s\\n\" \"create $prefix/foo $E\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -367,7 +365,7 @@ test_expect_success 'incorrect old value blocks delete' '\n \tprefix=refs/incorrect-delete &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"delete $prefix/foo $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -378,7 +376,7 @@ test_expect_success 'missing old value blocks indirect update' '\n \tprefix=refs/missing-indirect-update &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -390,7 +388,7 @@ test_expect_success 'incorrect old value blocks indirect update' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -402,7 +400,7 @@ test_expect_success 'existing old value blocks indirect create' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists\n \tEOF\n \tprintf \"%s\\n\" \"create $prefix/symref $E\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -414,7 +412,7 @@ test_expect_success 'incorrect old value blocks indirect delete' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"delete $prefix/symref $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -425,7 +423,7 @@ test_expect_success 'missing old value blocks indirect no-deref update' '\n \tprefix=refs/missing-noderef-update &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: reference is missing but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference is missing but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"option no-deref\" \"update $prefix/symref $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -437,7 +435,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"option no-deref\" \"update $prefix/symref $E $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -449,7 +447,7 @@ test_expect_success 'existing old value blocks indirect no-deref create' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists\n \tEOF\n \tprintf \"%s\\n\" \"option no-deref\" \"create $prefix/symref $E\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -461,7 +459,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tgit update-ref $prefix/foo $C &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n \tEOF\n \tprintf \"%s\\n\" \"option no-deref\" \"delete $prefix/symref $D\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -474,13 +472,13 @@ test_expect_success 'non-empty directory blocks create' '\n \t: >.git/$prefix/foo/bar/baz.lock &&\n \ttest_when_finished \"rm -f .git/$prefix/foo/bar/baz.lock\" &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n \ttest_cmp expected output.err &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $D $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -493,13 +491,13 @@ test_expect_success 'broken reference blocks create' '\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n \ttest_when_finished \"rm -f .git/$prefix/foo\" &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n \ttest_cmp expected output.err &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n+\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/foo $D $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -513,13 +511,13 @@ test_expect_success 'non-empty directory blocks indirect create' '\n \t: >.git/$prefix/foo/bar/baz.lock &&\n \ttest_when_finished \"rm -f .git/$prefix/foo/bar/baz.lock\" &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n \ttest_cmp expected output.err &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $D $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -532,13 +530,13 @@ test_expect_success 'broken reference blocks indirect create' '\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n \ttest_when_finished \"rm -f .git/$prefix/foo\" &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n \ttest_cmp expected output.err &&\n \tcat >expected <<-EOF &&\n-\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n+\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n \tEOF\n \tprintf \"%s\\n\" \"update $prefix/symref $D $C\" |\n \ttest_must_fail git update-ref --stdin 2>output.err &&\n@@ -614,7 +612,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n \ttest_when_finished \"rm -f .git/packed-refs.lock\" &&\n \ttest_must_fail git update-ref -d $prefix/foo >out 2>err &&\n \tgit for-each-ref $prefix >actual &&\n-\ttest_i18ngrep \"Unable to create $Q.*packed-refs.lock$Q: \" err &&\n+\ttest_i18ngrep \"Unable to create $SQ.*packed-refs.lock$SQ: \" err &&\n \ttest_cmp unchanged actual\n '\n \ndiff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\nindex feb1efd8ff..1181a9fb28 100755\n--- a/t/t1414-reflog-walk.sh\n+++ b/t/t1414-reflog-walk.sh\n@@ -18,10 +18,9 @@ do_walk () {\n \tgit log -g --format=\"%gd %gs\" \"$@\"\n }\n \n-sq=\"'\"\n test_expect_success 'set up expected reflog' '\n \tcat >expect.all <<-EOF\n-\tHEAD@{0} commit (merge): Merge branch ${sq}master${sq} into side\n+\tHEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side\n \tHEAD@{1} commit: three\n \tHEAD@{2} checkout: moving from master to side\n \tHEAD@{3} commit: two\ndiff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh\nindex 4ee009da66..21a9c8ffb2 100755\n--- a/t/t1506-rev-parse-diagnosis.sh\n+++ b/t/t1506-rev-parse-diagnosis.sh\n@@ -8,10 +8,9 @@ exec </dev/null\n \n test_did_you_mean ()\n {\n-\tsq=\"'\" &&\n \tcat >expected <<-EOF &&\n-\tfatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.\n-\tDid you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n+\tfatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.\n+\tDid you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?\n \tEOF\n \ttest_cmp expected error\n }\ndiff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh\nindex fa3e499641..8b4cf8a6e3 100755\n--- a/t/t1507-rev-parse-upstream.sh\n+++ b/t/t1507-rev-parse-upstream.sh\n@@ -28,8 +28,6 @@ test_expect_success 'setup' '\n \t)\n '\n \n-sq=\"'\"\n-\n full_name () {\n \t(cd clone &&\n \t git rev-parse --symbolic-full-name \"$@\")\n@@ -129,7 +127,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '\n \tgit branch -t new my-side@{u} &&\n \tgit merge -s ours new@{u} &&\n \tgit show -s --pretty=tformat:%s >actual &&\n-\techo \"Merge remote-tracking branch ${sq}origin/side${sq}\" >expect &&\n+\techo \"Merge remote-tracking branch ${SQ}origin/side${SQ}\" >expect &&\n \ttest_cmp expect actual\n )\n '\n@@ -156,7 +154,7 @@ test_expect_success 'branch@{u} works when tracking a local branch' '\n \n test_expect_success 'branch@{u} error message when no upstream' '\n \tcat >expect <<-EOF &&\n-\tfatal: no upstream configured for branch ${sq}non-tracking${sq}\n+\tfatal: no upstream configured for branch ${SQ}non-tracking${SQ}\n \tEOF\n \terror_message non-tracking@{u} &&\n \ttest_i18ncmp expect error\n@@ -164,7 +162,7 @@ test_expect_success 'branch@{u} error message when no upstream' '\n \n test_expect_success '@{u} error message when no upstream' '\n \tcat >expect <<-EOF &&\n-\tfatal: no upstream configured for branch ${sq}master${sq}\n+\tfatal: no upstream configured for branch ${SQ}master${SQ}\n \tEOF\n \ttest_must_fail git rev-parse --verify @{u} 2>actual &&\n \ttest_i18ncmp expect actual\n@@ -172,7 +170,7 @@ test_expect_success '@{u} error message when no upstream' '\n \n test_expect_success 'branch@{u} error message with misspelt branch' '\n \tcat >expect <<-EOF &&\n-\tfatal: no such branch: ${sq}no-such-branch${sq}\n+\tfatal: no such branch: ${SQ}no-such-branch${SQ}\n \tEOF\n \terror_message no-such-branch@{u} &&\n \ttest_i18ncmp expect error\n@@ -189,7 +187,7 @@ test_expect_success '@{u} error message when not on a branch' '\n \n test_expect_success 'branch@{u} error message if upstream branch not fetched' '\n \tcat >expect <<-EOF &&\n-\tfatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch\n+\tfatal: upstream branch ${SQ}refs/heads/side${SQ} not stored as a remote-tracking branch\n \tEOF\n \terror_message bad-upstream@{u} &&\n \ttest_i18ncmp expect error\ndiff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\nindex 209b4c7cd8..c841f9b454 100755\n--- a/t/t3005-ls-files-relative.sh\n+++ b/t/t3005-ls-files-relative.sh\n@@ -9,7 +9,6 @@ This test runs git ls-files with various relative path arguments.\n \n new_line='\n '\n-sq=\\'\n \n test_expect_success 'prepare' '\n \t: >never-mind-me &&\n@@ -44,9 +43,9 @@ test_expect_success 'ls-files -c' '\n \t\tcd top/sub &&\n \t\tfor f in ../y*\n \t\tdo\n-\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n+\t\t\techo \"error: pathspec $SQ$f$SQ did not match any file(s) known to git\"\n \t\tdone >expect.err &&\n-\t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n+\t\techo \"Did you forget to ${SQ}git add${SQ}?\" >>expect.err &&\n \t\tls ../x* >expect.out &&\n \t\ttest_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n \t\ttest_cmp expect.out actual.out &&\n@@ -59,9 +58,9 @@ test_expect_success 'ls-files -o' '\n \t\tcd top/sub &&\n \t\tfor f in ../x*\n \t\tdo\n-\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n+\t\t\techo \"error: pathspec $SQ$f$SQ did not match any file(s) known to git\"\n \t\tdone >expect.err &&\n-\t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n+\t\techo \"Did you forget to ${SQ}git add${SQ}?\" >>expect.err &&\n \t\tls ../y* >expect.out &&\n \t\ttest_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n \t\ttest_cmp expect.out actual.out &&\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 461dd539ff..9c152b6245 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -1419,7 +1419,6 @@ test_expect_success 'editor saves as CR/LF' '\n \t)\n '\n \n-SQ=\"'\"\n test_expect_success 'rebase -i --gpg-sign=<key-id>' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tset_fake_editor &&\ndiff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh\nindex 7b6c4847ad..11141ac864 100755\n--- a/t/t3430-rebase-merges.sh\n+++ b/t/t3430-rebase-merges.sh\n@@ -151,7 +151,6 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '\n \ttest_path_is_file .git/rebase-merge/patch\n '\n \n-SQ=\"'\"\n test_expect_success 'failed `merge <branch>` does not crash' '\n \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n \tgit checkout conflicting-G &&\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 4a3b901f06..3be025a658 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -434,7 +434,6 @@ test_expect_success 'double quoted plink.exe in GIT_SSH_COMMAND' '\n \texpect_ssh \"-v -P 123\" myhost src\n '\n \n-SQ=\"'\"\n test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' '\n \tcopy_ssh_wrapper_as \"$TRASH_DIRECTORY/plink.exe\" &&\n \tGIT_SSH_COMMAND=\"$SQ$TRASH_DIRECTORY/plink.exe$SQ -v\" \\\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex c973278300..df34c994d2 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -158,7 +158,6 @@ test_expect_success 'submodule update --init from and of subdirectory' '\n \ttest_i18ncmp expect2 actual2\n '\n \n-apos=\"'\";\n test_expect_success 'submodule update does not fetch already present commits' '\n \t(cd submodule &&\n \t  echo line3 >> file &&\n@@ -168,7 +167,7 @@ test_expect_success 'submodule update does not fetch already present commits' '\n \t) &&\n \t(cd super/submodule &&\n \t  head=$(git rev-parse --verify HEAD) &&\n-\t  echo \"Submodule path ${apos}submodule$apos: checked out $apos$head$apos\" > ../../expected &&\n+\t  echo \"Submodule path ${SQ}submodule$SQ: checked out $SQ$head$SQ\" > ../../expected &&\n \t  git reset --hard HEAD~1\n \t) &&\n \t(cd super &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex a9d45642a5..ee602c4d9c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -509,6 +509,9 @@ EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n LF='\n '\n \n+# Single quote\n+SQ=\\'\n+\n # UTF-8 ZERO WIDTH NON-JOINER, which HFS+ ignores\n # when case-folding filenames\n u200c=$(printf '\\342\\200\\214')\n-- \n2.23.0.37.g745f681289\n\n"},{"id":"381926","messageId":"20190905222526.GA29743@syl.local","threadId":"51797","inReplyTo":"0598bbf4d0b2cb07ff6f06f904cbdd3f5a3ae1af.1567721303.git.liu.denton@gmail.com","subject":"Re: [PATCH] t: use common $SQ variable","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2019-09-05T22:25:26Z","receivedAt":"2019-09-05T22:25:30Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:\n> In many test scripts, there are bespoke definitions of the single quote\n> that are some variation of this:\n>\n>     SQ=\"'\"\n>\n> Define a common $SQ variable in test-lib.sh and replace all usages of\n> these bespoke variables with the common one.\n>\n> This change was done by running `git grep =\\\"\\'\\\" t/` and\n> `git grep =\\\\\\\\\\'` and manually changing the resulting definitions and\n> corresponding usages.\n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n>\n> [whoops, forgot to include the mailing list in the last email]\n>\n> Sorry, I wrote this patch up before I saw the email about leaving this\n> as #leftoverbits. No point in letting it go to waste, though.\n\nThanks for doing this. I marked it as '#leftoverbits' in case anybody\nhosting an Outreachy intern might be interested in having something\nsmall for a newcomer to dip their toes into sending to the mailing list.\n\nBut, there's no shortage of other such tasks, I'd assume, so it's good\nthat you cleaned these up.\n\nBoth of your 'git grep' invocations look correct to me, so the patch\nbelow looks like an obviously-correct result. Thanks.\n\n-Taylor\n"},{"id":"381927","messageId":"20190905222736.GA29792@syl.local","threadId":"51797","inReplyTo":"20190905222526.GA29743@syl.local","subject":"Re: [PATCH] t: use common $SQ variable","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2019-09-05T22:27:36Z","receivedAt":"2019-09-05T22:27:39Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Thu, Sep 05, 2019 at 06:25:26PM -0400, Taylor Blau wrote:\n> On Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:\n> > In many test scripts, there are bespoke definitions of the single quote\n> > that are some variation of this:\n> >\n> >     SQ=\"'\"\n> >\n> > Define a common $SQ variable in test-lib.sh and replace all usages of\n> > these bespoke variables with the common one.\n> >\n> > This change was done by running `git grep =\\\"\\'\\\" t/` and\n> > `git grep =\\\\\\\\\\'` and manually changing the resulting definitions and\n> > corresponding usages.\n> > Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> > ---\n> >\n> > [whoops, forgot to include the mailing list in the last email]\n> >\n> > Sorry, I wrote this patch up before I saw the email about leaving this\n> > as #leftoverbits. No point in letting it go to waste, though.\n>\n> Thanks for doing this. I marked it as '#leftoverbits' in case anybody\n> hosting an Outreachy intern might be interested in having something\n> small for a newcomer to dip their toes into sending to the mailing list.\n\nOh, how silly of me. I was thinking about [1], which I said would be\ngood #leftoverbits material. This thread was tagged by Junio, not me.\nThe rest of my point stands, though ;).\n\n> But, there's no shortage of other such tasks, I'd assume, so it's good\n> that you cleaned these up.\n>\n> Both of your 'git grep' invocations look correct to me, so the patch\n> below looks like an obviously-correct result. Thanks.\n>\n> -Taylor\nThanks,\nTaylor\n\n[1]: https://public-inbox.org/git/20190904212121.GB20904@syl.local/\n"},{"id":"381944","messageId":"20190906020454.GA19967@archbookpro.localdomain","threadId":"51797","inReplyTo":"0598bbf4d0b2cb07ff6f06f904cbdd3f5a3ae1af.1567721303.git.liu.denton@gmail.com","subject":"Re: [PATCH] t: use common $SQ variable","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-09-06T02:04:54Z","receivedAt":"2019-09-06T02:05:00Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"I should've noted earlier that this patch applies cleanly on top of the\n\"jc/tests-use-lf-from-test-lib\" branch.\n\nOn Thu, Sep 05, 2019 at 03:10:05PM -0700, Denton Liu wrote:\n> In many test scripts, there are bespoke definitions of the single quote\n> that are some variation of this:\n> \n>     SQ=\"'\"\n> \n> Define a common $SQ variable in test-lib.sh and replace all usages of\n> these bespoke variables with the common one.\n> \n> This change was done by running `git grep =\\\"\\'\\\" t/` and\n> `git grep =\\\\\\\\\\'` and manually changing the resulting definitions and\n\nOops, this invocation wasn't exactly correct; it's missing the `t/` at\nthe end. The full invocation should read `git grep =\\\\\\\\\\' t/`.\n\n> corresponding usages.\n> \n> Signed-off-by: Denton Liu <liu.denton@gmail.com>\n> ---\n> \n> [whoops, forgot to include the mailing list in the last email]\n> \n> Sorry, I wrote this patch up before I saw the email about leaving this\n> as #leftoverbits. No point in letting it go to waste, though.\n> \n>  t/t1300-config.sh              |  9 +++--\n>  t/t1404-update-ref-errors.sh   | 64 ++++++++++++++++------------------\n>  t/t1414-reflog-walk.sh         |  3 +-\n>  t/t1506-rev-parse-diagnosis.sh |  5 ++-\n>  t/t1507-rev-parse-upstream.sh  | 12 +++----\n>  t/t3005-ls-files-relative.sh   |  9 +++--\n>  t/t3404-rebase-interactive.sh  |  1 -\n>  t/t3430-rebase-merges.sh       |  1 -\n>  t/t5601-clone.sh               |  1 -\n>  t/t7406-submodule-update.sh    |  3 +-\n>  t/test-lib.sh                  |  3 ++\n>  11 files changed, 51 insertions(+), 60 deletions(-)\n> \n> diff --git a/t/t1300-config.sh b/t/t1300-config.sh\n> index 428177c390..983a0a1583 100755\n> --- a/t/t1300-config.sh\n> +++ b/t/t1300-config.sh\n> @@ -1294,26 +1294,25 @@ test_expect_success 'git -c is not confused by empty environment' '\n>  \tGIT_CONFIG_PARAMETERS=\"\" git -c x.one=1 config --list\n>  '\n>  \n> -sq=\"'\"\n>  test_expect_success 'detect bogus GIT_CONFIG_PARAMETERS' '\n>  \tcat >expect <<-\\EOF &&\n>  \tenv.one one\n>  \tenv.two two\n>  \tEOF\n> -\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq} ${sq}env.two=two${sq}\" \\\n> +\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ} ${SQ}env.two=two${SQ}\" \\\n>  \t\tgit config --get-regexp \"env.*\" >actual &&\n>  \ttest_cmp expect actual &&\n>  \n>  \tcat >expect <<-EOF &&\n> -\tenv.one one${sq}\n> +\tenv.one one${SQ}\n>  \tenv.two two\n>  \tEOF\n> -\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq}\\\\$sq$sq$sq ${sq}env.two=two${sq}\" \\\n> +\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ}\\\\$SQ$SQ$SQ ${SQ}env.two=two${SQ}\" \\\n>  \t\tgit config --get-regexp \"env.*\" >actual &&\n>  \ttest_cmp expect actual &&\n>  \n>  \ttest_must_fail env \\\n> -\t\tGIT_CONFIG_PARAMETERS=\"${sq}env.one=one${sq}\\\\$sq ${sq}env.two=two${sq}\" \\\n> +\t\tGIT_CONFIG_PARAMETERS=\"${SQ}env.one=one${SQ}\\\\$SQ ${SQ}env.two=two${SQ}\" \\\n>  \t\tgit config --get-regexp \"env.*\"\n>  '\n>  \n> diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\n> index 970c5c36b9..2d142e5535 100755\n> --- a/t/t1404-update-ref-errors.sh\n> +++ b/t/t1404-update-ref-errors.sh\n> @@ -32,8 +32,6 @@ test_update_rejected () {\n>  \ttest_cmp unchanged actual\n>  }\n>  \n> -Q=\"'\"\n> -\n>  # Test adding and deleting D/F-conflicting references in a single\n>  # transaction.\n>  df_test() {\n> @@ -93,7 +91,7 @@ df_test() {\n>  \t\tdelname=\"$delref\"\n>  \tfi &&\n>  \tcat >expected-err <<-EOF &&\n> -\tfatal: cannot lock ref $Q$addname$Q: $Q$delref$Q exists; cannot create $Q$addref$Q\n> +\tfatal: cannot lock ref $SQ$addname$SQ: $SQ$delref$SQ exists; cannot create $SQ$addref$SQ\n>  \tEOF\n>  \t$pack &&\n>  \tif $add_del\n> @@ -123,7 +121,7 @@ test_expect_success 'existing loose ref is a simple prefix of new' '\n>  \n>  \tprefix=refs/1l &&\n>  \ttest_update_rejected \"a c e\" false \"b c/x d\" \\\n> -\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q\"\n> +\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ\"\n>  \n>  '\n>  \n> @@ -131,7 +129,7 @@ test_expect_success 'existing packed ref is a simple prefix of new' '\n>  \n>  \tprefix=refs/1p &&\n>  \ttest_update_rejected \"a c e\" true \"b c/x d\" \\\n> -\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x$Q\"\n> +\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ\"\n>  \n>  '\n>  \n> @@ -139,7 +137,7 @@ test_expect_success 'existing loose ref is a deeper prefix of new' '\n>  \n>  \tprefix=refs/2l &&\n>  \ttest_update_rejected \"a c e\" false \"b c/x/y d\" \\\n> -\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q\"\n> +\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ\"\n>  \n>  '\n>  \n> @@ -147,7 +145,7 @@ test_expect_success 'existing packed ref is a deeper prefix of new' '\n>  \n>  \tprefix=refs/2p &&\n>  \ttest_update_rejected \"a c e\" true \"b c/x/y d\" \\\n> -\t\t\"$Q$prefix/c$Q exists; cannot create $Q$prefix/c/x/y$Q\"\n> +\t\t\"$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ\"\n>  \n>  '\n>  \n> @@ -155,7 +153,7 @@ test_expect_success 'new ref is a simple prefix of existing loose' '\n>  \n>  \tprefix=refs/3l &&\n>  \ttest_update_rejected \"a c/x e\" false \"b c d\" \\\n> -\t\t\"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q\"\n> +\t\t\"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ\"\n>  \n>  '\n>  \n> @@ -163,7 +161,7 @@ test_expect_success 'new ref is a simple prefix of existing packed' '\n>  \n>  \tprefix=refs/3p &&\n>  \ttest_update_rejected \"a c/x e\" true \"b c d\" \\\n> -\t\t\"$Q$prefix/c/x$Q exists; cannot create $Q$prefix/c$Q\"\n> +\t\t\"$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ\"\n>  \n>  '\n>  \n> @@ -171,7 +169,7 @@ test_expect_success 'new ref is a deeper prefix of existing loose' '\n>  \n>  \tprefix=refs/4l &&\n>  \ttest_update_rejected \"a c/x/y e\" false \"b c d\" \\\n> -\t\t\"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q\"\n> +\t\t\"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ\"\n>  \n>  '\n>  \n> @@ -179,7 +177,7 @@ test_expect_success 'new ref is a deeper prefix of existing packed' '\n>  \n>  \tprefix=refs/4p &&\n>  \ttest_update_rejected \"a c/x/y e\" true \"b c d\" \\\n> -\t\t\"$Q$prefix/c/x/y$Q exists; cannot create $Q$prefix/c$Q\"\n> +\t\t\"$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ\"\n>  \n>  '\n>  \n> @@ -187,7 +185,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n>  \n>  \tprefix=refs/5 &&\n>  \ttest_update_rejected \"a e\" false \"b c c/x d\" \\\n> -\t\t\"cannot process $Q$prefix/c$Q and $Q$prefix/c/x$Q at the same time\"\n> +\t\t\"cannot process $SQ$prefix/c$SQ and $SQ$prefix/c/x$SQ at the same time\"\n>  \n>  '\n>  \n> @@ -334,7 +332,7 @@ test_expect_success 'D/F conflict prevents indirect delete long packed + indirec\n>  test_expect_success 'missing old value blocks update' '\n>  \tprefix=refs/missing-update &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -345,7 +343,7 @@ test_expect_success 'incorrect old value blocks update' '\n>  \tprefix=refs/incorrect-update &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -356,7 +354,7 @@ test_expect_success 'existing old value blocks create' '\n>  \tprefix=refs/existing-create &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: reference already exists\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: reference already exists\n>  \tEOF\n>  \tprintf \"%s\\n\" \"create $prefix/foo $E\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -367,7 +365,7 @@ test_expect_success 'incorrect old value blocks delete' '\n>  \tprefix=refs/incorrect-delete &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"delete $prefix/foo $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -378,7 +376,7 @@ test_expect_success 'missing old value blocks indirect update' '\n>  \tprefix=refs/missing-indirect-update &&\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -390,7 +388,7 @@ test_expect_success 'incorrect old value blocks indirect update' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -402,7 +400,7 @@ test_expect_success 'existing old value blocks indirect create' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists\n>  \tEOF\n>  \tprintf \"%s\\n\" \"create $prefix/symref $E\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -414,7 +412,7 @@ test_expect_success 'incorrect old value blocks indirect delete' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"delete $prefix/symref $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -425,7 +423,7 @@ test_expect_success 'missing old value blocks indirect no-deref update' '\n>  \tprefix=refs/missing-noderef-update &&\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: reference is missing but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference is missing but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"option no-deref\" \"update $prefix/symref $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -437,7 +435,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"option no-deref\" \"update $prefix/symref $E $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -449,7 +447,7 @@ test_expect_success 'existing old value blocks indirect no-deref create' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: reference already exists\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists\n>  \tEOF\n>  \tprintf \"%s\\n\" \"option no-deref\" \"create $prefix/symref $E\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -461,7 +459,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: is at $C but expected $D\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D\n>  \tEOF\n>  \tprintf \"%s\\n\" \"option no-deref\" \"delete $prefix/symref $D\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -474,13 +472,13 @@ test_expect_success 'non-empty directory blocks create' '\n>  \t: >.git/$prefix/foo/bar/baz.lock &&\n>  \ttest_when_finished \"rm -f .git/$prefix/foo/bar/baz.lock\" &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n>  \ttest_cmp expected output.err &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $D $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -493,13 +491,13 @@ test_expect_success 'broken reference blocks create' '\n>  \techo \"gobbledigook\" >.git/$prefix/foo &&\n>  \ttest_when_finished \"rm -f .git/$prefix/foo\" &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n>  \ttest_cmp expected output.err &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/foo$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n> +\tfatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/foo $D $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -513,13 +511,13 @@ test_expect_success 'non-empty directory blocks indirect create' '\n>  \t: >.git/$prefix/foo/bar/baz.lock &&\n>  \ttest_when_finished \"rm -f .git/$prefix/foo/bar/baz.lock\" &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: there is a non-empty directory $Q.git/$prefix/foo$Q blocking reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n>  \ttest_cmp expected output.err &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $D $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -532,13 +530,13 @@ test_expect_success 'broken reference blocks indirect create' '\n>  \techo \"gobbledigook\" >.git/$prefix/foo &&\n>  \ttest_when_finished \"rm -f .git/$prefix/foo\" &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n>  \ttest_cmp expected output.err &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: cannot lock ref $Q$prefix/symref$Q: unable to resolve reference $Q$prefix/foo$Q: reference broken\n> +\tfatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken\n>  \tEOF\n>  \tprintf \"%s\\n\" \"update $prefix/symref $D $C\" |\n>  \ttest_must_fail git update-ref --stdin 2>output.err &&\n> @@ -614,7 +612,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n>  \ttest_when_finished \"rm -f .git/packed-refs.lock\" &&\n>  \ttest_must_fail git update-ref -d $prefix/foo >out 2>err &&\n>  \tgit for-each-ref $prefix >actual &&\n> -\ttest_i18ngrep \"Unable to create $Q.*packed-refs.lock$Q: \" err &&\n> +\ttest_i18ngrep \"Unable to create $SQ.*packed-refs.lock$SQ: \" err &&\n>  \ttest_cmp unchanged actual\n>  '\n>  \n> diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\n> index feb1efd8ff..1181a9fb28 100755\n> --- a/t/t1414-reflog-walk.sh\n> +++ b/t/t1414-reflog-walk.sh\n> @@ -18,10 +18,9 @@ do_walk () {\n>  \tgit log -g --format=\"%gd %gs\" \"$@\"\n>  }\n>  \n> -sq=\"'\"\n>  test_expect_success 'set up expected reflog' '\n>  \tcat >expect.all <<-EOF\n> -\tHEAD@{0} commit (merge): Merge branch ${sq}master${sq} into side\n> +\tHEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side\n>  \tHEAD@{1} commit: three\n>  \tHEAD@{2} checkout: moving from master to side\n>  \tHEAD@{3} commit: two\n> diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh\n> index 4ee009da66..21a9c8ffb2 100755\n> --- a/t/t1506-rev-parse-diagnosis.sh\n> +++ b/t/t1506-rev-parse-diagnosis.sh\n> @@ -8,10 +8,9 @@ exec </dev/null\n>  \n>  test_did_you_mean ()\n>  {\n> -\tsq=\"'\" &&\n>  \tcat >expected <<-EOF &&\n> -\tfatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.\n> -\tDid you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n> +\tfatal: Path '$2$3' $4, but not ${5:-$SQ$3$SQ}.\n> +\tDid you mean '$1:$2$3'${2:+ aka $SQ$1:./$3$SQ}?\n>  \tEOF\n>  \ttest_cmp expected error\n>  }\n> diff --git a/t/t1507-rev-parse-upstream.sh b/t/t1507-rev-parse-upstream.sh\n> index fa3e499641..8b4cf8a6e3 100755\n> --- a/t/t1507-rev-parse-upstream.sh\n> +++ b/t/t1507-rev-parse-upstream.sh\n> @@ -28,8 +28,6 @@ test_expect_success 'setup' '\n>  \t)\n>  '\n>  \n> -sq=\"'\"\n> -\n>  full_name () {\n>  \t(cd clone &&\n>  \t git rev-parse --symbolic-full-name \"$@\")\n> @@ -129,7 +127,7 @@ test_expect_success 'merge my-side@{u} records the correct name' '\n>  \tgit branch -t new my-side@{u} &&\n>  \tgit merge -s ours new@{u} &&\n>  \tgit show -s --pretty=tformat:%s >actual &&\n> -\techo \"Merge remote-tracking branch ${sq}origin/side${sq}\" >expect &&\n> +\techo \"Merge remote-tracking branch ${SQ}origin/side${SQ}\" >expect &&\n>  \ttest_cmp expect actual\n>  )\n>  '\n> @@ -156,7 +154,7 @@ test_expect_success 'branch@{u} works when tracking a local branch' '\n>  \n>  test_expect_success 'branch@{u} error message when no upstream' '\n>  \tcat >expect <<-EOF &&\n> -\tfatal: no upstream configured for branch ${sq}non-tracking${sq}\n> +\tfatal: no upstream configured for branch ${SQ}non-tracking${SQ}\n>  \tEOF\n>  \terror_message non-tracking@{u} &&\n>  \ttest_i18ncmp expect error\n> @@ -164,7 +162,7 @@ test_expect_success 'branch@{u} error message when no upstream' '\n>  \n>  test_expect_success '@{u} error message when no upstream' '\n>  \tcat >expect <<-EOF &&\n> -\tfatal: no upstream configured for branch ${sq}master${sq}\n> +\tfatal: no upstream configured for branch ${SQ}master${SQ}\n>  \tEOF\n>  \ttest_must_fail git rev-parse --verify @{u} 2>actual &&\n>  \ttest_i18ncmp expect actual\n> @@ -172,7 +170,7 @@ test_expect_success '@{u} error message when no upstream' '\n>  \n>  test_expect_success 'branch@{u} error message with misspelt branch' '\n>  \tcat >expect <<-EOF &&\n> -\tfatal: no such branch: ${sq}no-such-branch${sq}\n> +\tfatal: no such branch: ${SQ}no-such-branch${SQ}\n>  \tEOF\n>  \terror_message no-such-branch@{u} &&\n>  \ttest_i18ncmp expect error\n> @@ -189,7 +187,7 @@ test_expect_success '@{u} error message when not on a branch' '\n>  \n>  test_expect_success 'branch@{u} error message if upstream branch not fetched' '\n>  \tcat >expect <<-EOF &&\n> -\tfatal: upstream branch ${sq}refs/heads/side${sq} not stored as a remote-tracking branch\n> +\tfatal: upstream branch ${SQ}refs/heads/side${SQ} not stored as a remote-tracking branch\n>  \tEOF\n>  \terror_message bad-upstream@{u} &&\n>  \ttest_i18ncmp expect error\n> diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh\n> index 209b4c7cd8..c841f9b454 100755\n> --- a/t/t3005-ls-files-relative.sh\n> +++ b/t/t3005-ls-files-relative.sh\n> @@ -9,7 +9,6 @@ This test runs git ls-files with various relative path arguments.\n>  \n>  new_line='\n>  '\n> -sq=\\'\n>  \n>  test_expect_success 'prepare' '\n>  \t: >never-mind-me &&\n> @@ -44,9 +43,9 @@ test_expect_success 'ls-files -c' '\n>  \t\tcd top/sub &&\n>  \t\tfor f in ../y*\n>  \t\tdo\n> -\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n> +\t\t\techo \"error: pathspec $SQ$f$SQ did not match any file(s) known to git\"\n>  \t\tdone >expect.err &&\n> -\t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n> +\t\techo \"Did you forget to ${SQ}git add${SQ}?\" >>expect.err &&\n>  \t\tls ../x* >expect.out &&\n>  \t\ttest_must_fail git ls-files -c --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n>  \t\ttest_cmp expect.out actual.out &&\n> @@ -59,9 +58,9 @@ test_expect_success 'ls-files -o' '\n>  \t\tcd top/sub &&\n>  \t\tfor f in ../x*\n>  \t\tdo\n> -\t\t\techo \"error: pathspec $sq$f$sq did not match any file(s) known to git\"\n> +\t\t\techo \"error: pathspec $SQ$f$SQ did not match any file(s) known to git\"\n>  \t\tdone >expect.err &&\n> -\t\techo \"Did you forget to ${sq}git add${sq}?\" >>expect.err &&\n> +\t\techo \"Did you forget to ${SQ}git add${SQ}?\" >>expect.err &&\n>  \t\tls ../y* >expect.out &&\n>  \t\ttest_must_fail git ls-files -o --error-unmatch ../[xy]* >actual.out 2>actual.err &&\n>  \t\ttest_cmp expect.out actual.out &&\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 461dd539ff..9c152b6245 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -1419,7 +1419,6 @@ test_expect_success 'editor saves as CR/LF' '\n>  \t)\n>  '\n>  \n> -SQ=\"'\"\n>  test_expect_success 'rebase -i --gpg-sign=<key-id>' '\n>  \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n>  \tset_fake_editor &&\n> diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh\n> index 7b6c4847ad..11141ac864 100755\n> --- a/t/t3430-rebase-merges.sh\n> +++ b/t/t3430-rebase-merges.sh\n> @@ -151,7 +151,6 @@ test_expect_success 'failed `merge -C` writes patch (may be rescheduled, too)' '\n>  \ttest_path_is_file .git/rebase-merge/patch\n>  '\n>  \n> -SQ=\"'\"\n>  test_expect_success 'failed `merge <branch>` does not crash' '\n>  \ttest_when_finished \"test_might_fail git rebase --abort\" &&\n>  \tgit checkout conflicting-G &&\n> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\n> index 4a3b901f06..3be025a658 100755\n> --- a/t/t5601-clone.sh\n> +++ b/t/t5601-clone.sh\n> @@ -434,7 +434,6 @@ test_expect_success 'double quoted plink.exe in GIT_SSH_COMMAND' '\n>  \texpect_ssh \"-v -P 123\" myhost src\n>  '\n>  \n> -SQ=\"'\"\n>  test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' '\n>  \tcopy_ssh_wrapper_as \"$TRASH_DIRECTORY/plink.exe\" &&\n>  \tGIT_SSH_COMMAND=\"$SQ$TRASH_DIRECTORY/plink.exe$SQ -v\" \\\n> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\n> index c973278300..df34c994d2 100755\n> --- a/t/t7406-submodule-update.sh\n> +++ b/t/t7406-submodule-update.sh\n> @@ -158,7 +158,6 @@ test_expect_success 'submodule update --init from and of subdirectory' '\n>  \ttest_i18ncmp expect2 actual2\n>  '\n>  \n> -apos=\"'\";\n>  test_expect_success 'submodule update does not fetch already present commits' '\n>  \t(cd submodule &&\n>  \t  echo line3 >> file &&\n> @@ -168,7 +167,7 @@ test_expect_success 'submodule update does not fetch already present commits' '\n>  \t) &&\n>  \t(cd super/submodule &&\n>  \t  head=$(git rev-parse --verify HEAD) &&\n> -\t  echo \"Submodule path ${apos}submodule$apos: checked out $apos$head$apos\" > ../../expected &&\n> +\t  echo \"Submodule path ${SQ}submodule$SQ: checked out $SQ$head$SQ\" > ../../expected &&\n>  \t  git reset --hard HEAD~1\n>  \t) &&\n>  \t(cd super &&\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index a9d45642a5..ee602c4d9c 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -509,6 +509,9 @@ EMPTY_BLOB=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\n>  LF='\n>  '\n>  \n> +# Single quote\n> +SQ=\\'\n> +\n>  # UTF-8 ZERO WIDTH NON-JOINER, which HFS+ ignores\n>  # when case-folding filenames\n>  u200c=$(printf '\\342\\200\\214')\n> -- \n> 2.23.0.37.g745f681289\n> \n"}]}