{"thread":{"id":"57695","subject":"[PATCH] t9902: split test to run on appropriate systems","startedAt":"2022-04-08T09:55:16Z","lastAt":"2022-05-02T15:03:08Z","messageCount":4,"participants":["Adam Dinwoodie","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"453325","messageId":"20220408095353.11183-1-adam@dinwoodie.org","threadId":"57695","inReplyTo":null,"subject":"[PATCH] t9902: split test to run on appropriate systems","fromName":"Adam Dinwoodie","fromEmail":"adam@dinwoodie.org","sentAt":"2022-04-08T09:53:53Z","receivedAt":"2022-04-08T09:55:16Z","isPatch":true,"sender":{"key":"adam@dinwoodie.org","avatar":"https://avatars.githubusercontent.com/u/1397507?v=4"},"body":"The \"FUNNYNAMES\" test prerequisite passes on Cygwin, as the Cygwin\nfile system interface has a workaround for the underlying operating\nsystem's lack of support for tabs, newlines or quotes.  However, it does\nnot add support for backslash, which is treated as a directory\nseparator, meaning one of the tests added by 48803821b1 (\"completion:\nhandle unusual characters for sparse-checkout\", 2022-02-07) will fail on\nCygwin.\n\nTo avoid this failure while still getting maximal test coverage, split\nthat test into two: test handling of paths that include tabs on anything\nthat has the FUNNYNAMES prerequisite, but skip testing handling of paths\nthat include backslashes unless both FUNNYNAMES is set and the system is\nnot Cygwin.\n\nIt might be nice to have more granularity than \"FUNNYNAMES\" and its\nsibling \"FUNNIERNAMES\" provide, so that tests could be run based on\nspecific individual characters supported by the file system being\ntested, but that seems like it would make the prerequisite checks in\nthis area much more verbose for very little gain.\n\nSigned-off-by: Adam Dinwoodie <adam@dinwoodie.org>\n---\n t/t9902-completion.sh | 35 ++++++++++++++++++++++++++---------\n 1 file changed, 26 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 24117cb901..31526e6b64 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -1529,28 +1529,45 @@ test_expect_success 'cone mode sparse-checkout completes directory names with sp\n \t)\n '\n \n-# use FUNNYNAMES to avoid running on Windows, which doesn't permit backslashes or tabs in paths\n-test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with backslashes and tabs' '\n+# use FUNNYNAMES to avoid running on Windows, which doesn't permit tabs in paths\n+test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with tabs' '\n \t# reset sparse-checkout\n \tgit -C sparse-checkout sparse-checkout disable &&\n \t(\n \t\tcd sparse-checkout &&\n-\t\tmkdir \"directory\\with\\backslashes\" &&\n \t\tmkdir \"$(printf \"directory\\twith\\ttabs\")\" &&\n-\t\t>\"directory\\with\\backslashes/randomfile\" &&\n \t\t>\"$(printf \"directory\\twith\\ttabs\")/randomfile\" &&\n \t\tgit add . &&\n-\t\tgit commit -m \"Add directory with backslashes and directory with tabs\" &&\n-\t\tgit sparse-checkout set --cone \"directory\\with\\backslashes\" \\\n+\t\tgit commit -m \"Add directory with tabs\" &&\n+\t\tgit sparse-checkout set --cone \\\n \t\t\t\"$(printf \"directory\\twith\\ttabs\")\" &&\n \t\ttest_completion \"git sparse-checkout add dir\" <<-\\EOF &&\n-\t\tdirectory\\with\\backslashes/\n \t\tdirectory\twith\ttabs/\n \t\tEOF\n-\t\trm -rf \"directory\\with\\backslashes\" &&\n \t\trm -rf \"$(printf \"directory\\twith\\ttabs\")\" &&\n \t\tgit add . &&\n-\t\tgit commit -m \"Remove directory with backslashes and directory with tabs\"\n+\t\tgit commit -m \"Remove directory with tabs\"\n+\t)\n+'\n+\n+# use FUNNYNAMES to avoid running on Windows, and !CYGWIN for Cygwin, as neither permit backslashes in paths\n+test_expect_success FUNNYNAMES,!CYGWIN 'cone mode sparse-checkout completes directory names with backslashes' '\n+\t# reset sparse-checkout\n+\tgit -C sparse-checkout sparse-checkout disable &&\n+\t(\n+\t\tcd sparse-checkout &&\n+\t\tmkdir \"directory\\with\\backslashes\" &&\n+\t\t>\"directory\\with\\backslashes/randomfile\" &&\n+\t\tgit add . &&\n+\t\tgit commit -m \"Add directory with backslashes\" &&\n+\t\tgit sparse-checkout set --cone \\\n+\t\t\t\"directory\\with\\backslashes\" &&\n+\t\ttest_completion \"git sparse-checkout add dir\" <<-\\EOF &&\n+\t\tdirectory\\with\\backslashes/\n+\t\tEOF\n+\t\trm -rf \"directory\\with\\backslashes\" &&\n+\t\tgit add . &&\n+\t\tgit commit -m \"Remove directory with backslashes\"\n \t)\n '\n \n-- \n2.35.1\n\n"},{"id":"453327","messageId":"220408.86v8vjbzen.gmgdl@evledraar.gmail.com","threadId":"57695","inReplyTo":"20220408095353.11183-1-adam@dinwoodie.org","subject":"Re: [PATCH] t9902: split test to run on appropriate systems","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-04-08T10:56:30Z","receivedAt":"2022-04-08T11:14:16Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Apr 08 2022, Adam Dinwoodie wrote:\n\n> The \"FUNNYNAMES\" test prerequisite passes on Cygwin, as the Cygwin\n> file system interface has a workaround for the underlying operating\n> system's lack of support for tabs, newlines or quotes.  However, it does\n> not add support for backslash, which is treated as a directory\n> separator, meaning one of the tests added by 48803821b1 (\"completion:\n> handle unusual characters for sparse-checkout\", 2022-02-07) will fail on\n> Cygwin.\n>\n> To avoid this failure while still getting maximal test coverage, split\n> that test into two: test handling of paths that include tabs on anything\n> that has the FUNNYNAMES prerequisite, but skip testing handling of paths\n> that include backslashes unless both FUNNYNAMES is set and the system is\n> not Cygwin.\n>\n> It might be nice to have more granularity than \"FUNNYNAMES\" and its\n> sibling \"FUNNIERNAMES\" provide, so that tests could be run based on\n> specific individual characters supported by the file system being\n> tested, but that seems like it would make the prerequisite checks in\n> this area much more verbose for very little gain.\n\nFor getting the release out the door this seems like a sensible isolated\nfix, but I don't see why we wouldn't get more granularity here,\ni.e. something like the below.\n\nI converted all the straightforward cases, where these tests were either\na bit misleading, or we'd actually skip testing on some systems\nneedlessly e.g. if they supported \\t in a name but not \\n.\n\nThis leaves only 8 remaining cases of FUNNYNAMES, all of those similarly\nseem like subtle potential issues. I.e. we're creating files with\ncharacters like \"?\" or \"*\" in the name.\n\nBut the prerequisite never checks for that, we're just implicitly\nassuming that a FS that can do [\\t\\n\"] an also do [*?+] or whatever.\n\nIn the case of the \"rm\" test we'd unconditionally create a file with a\nspace in its name, but then conditional on FUNNYNAMES remove it.\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex e74a318ac33..7714fc4852f 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -17,12 +17,7 @@ test_expect_success 'Initialize test directory' '\n \tgit commit -m \"add normal files\"\n '\n \n-if test_have_prereq !FUNNYNAMES\n-then\n-\tsay 'Your filesystem does not allow tabs in filenames.'\n-fi\n-\n-test_expect_success FUNNYNAMES 'add files with funny names' '\n+test_expect_success FS_NAME_TAB,FS_NAME_NEWLINE 'add files with funny names' '\n \ttouch -- \"tab\tembedded\" \"newline${LF}embedded\" &&\n \tgit add -- \"tab\tembedded\" \"newline${LF}embedded\" &&\n \tgit commit -m \"add files with tabs and newlines\"\n@@ -94,8 +89,12 @@ test_expect_success 'Test that \"git rm -- -q\" succeeds (remove a file that looks\n \tgit rm -- -q\n '\n \n-test_expect_success FUNNYNAMES 'Test that \"git rm -f\" succeeds with embedded space, tab, or newline characters.' '\n-\tgit rm -f \"space embedded\" \"tab\tembedded\" \"newline${LF}embedded\"\n+test_expect_success FS_NAME_TAB,FS_NAME_NEWLINE 'Test that \"git rm -f\" succeeds with embedded tab or newline characters.' '\n+\tgit rm -f \"tab\tembedded\" \"newline${LF}embedded\"\n+'\n+\n+test_expect_success 'Test that \"git rm -f\" succeeds with embedded space.' '\n+\tgit rm -f \"space embedded\"\n '\n \n test_expect_success SANITY 'Test that \"git rm -f\" fails if its rm fails' '\ndiff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\nindex 9a292bac70c..5dbe688ab10 100755\n--- a/t/t4038-diff-combined.sh\n+++ b/t/t4038-diff-combined.sh\n@@ -482,7 +482,7 @@ test_expect_success '--combined-all-paths and --cc' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names' '\n+test_expect_success FS_NAME_TAB 'setup for --combined-all-paths with funny names' '\n \tgit branch side1d &&\n \tgit branch side2d &&\n \tgit checkout side1d &&\n@@ -507,7 +507,7 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'\n \thead=$(git rev-parse HEAD)\n '\n \n-test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names' '\n+test_expect_success FS_NAME_TAB '--combined-all-paths and --raw and funny names' '\n \tcat <<-EOF >expect &&\n \t::100644 100644 100644 $side1df $side2df $headf RR\t\"file\\twith\\ttabs\"\t\"i\\tam\\ttabbed\"\t\"fickle\\tnaming\"\n \tEOF\n@@ -516,13 +516,13 @@ test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names'\n \ttest_cmp expect actual\n '\n \n-test_expect_success FUNNYNAMES '--combined-all-paths and --raw -and -z and funny names' '\n+test_expect_success FS_NAME_TAB '--combined-all-paths and --raw -and -z and funny names' '\n \tprintf \"$head\\0::100644 100644 100644 $side1df $side2df $headf RR\\0file\\twith\\ttabs\\0i\\tam\\ttabbed\\0fickle\\tnaming\\0\" >expect &&\n \tgit diff-tree -c -M --raw --combined-all-paths -z HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success FUNNYNAMES '--combined-all-paths and --cc and funny names' '\n+test_expect_success FS_NAME_TAB '--combined-all-paths and --cc and funny names' '\n \tcat <<-\\EOF >expect &&\n \t--- \"a/file\\twith\\ttabs\"\n \t--- \"a/i\\tam\\ttabbed\"\ndiff --git a/t/t4135-apply-weird-filenames.sh b/t/t4135-apply-weird-filenames.sh\nindex 6bc3fb97a75..582666c691b 100755\n--- a/t/t4135-apply-weird-filenames.sh\n+++ b/t/t4135-apply-weird-filenames.sh\n@@ -53,9 +53,9 @@ try_filename() {\n \n try_filename 'plain'            'postimage.txt'\n try_filename 'with spaces'      'post image.txt'\n-try_filename 'with tab'         'post\timage.txt' FUNNYNAMES\n+try_filename 'with tab'         'post\timage.txt' FS_NAME_TAB\n try_filename 'with backslash'   'post\\image.txt' BSLASHPSPEC\n-try_filename 'with quote'       '\"postimage\".txt' FUNNYNAMES success failure success\n+try_filename 'with quote'       '\"postimage\".txt' FS_NAME_QUOTE success failure success\n \n test_expect_success 'whitespace-damaged traditional patch' '\n \techo postimage >expected &&\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex 69356011713..5b880552a05 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -82,7 +82,7 @@ test_expect_success setup '\n \t# Still a no-op.\n \tfunction dummy() {}\n \tEOF\n-\tif test_have_prereq FUNNYNAMES\n+\tif test_have_prereq FS_NAME_QUOTE\n \tthen\n \t\techo unusual >\"\\\"unusual\\\" pathname\" &&\n \t\techo unusual >\"t/nested \\\"unusual\\\" pathname\"\n@@ -525,7 +525,7 @@ do\n \t\ttest_cmp expected actual\n \t'\n \n-\ttest_expect_success FUNNYNAMES \"grep $L should quote unusual pathnames\" '\n+\ttest_expect_success FS_NAME_QUOTE \"grep $L should quote unusual pathnames\" '\n \t\tcat >expected <<-EOF &&\n \t\t${HC}\"\\\"unusual\\\" pathname\":unusual\n \t\t${HC}\"t/nested \\\"unusual\\\" pathname\":unusual\n@@ -534,7 +534,7 @@ do\n \t\ttest_cmp expected actual\n \t'\n \n-\ttest_expect_success FUNNYNAMES \"grep $L in subdir should quote unusual relative pathnames\" '\n+\ttest_expect_success FS_NAME_QUOTE \"grep $L in subdir should quote unusual relative pathnames\" '\n \t\tcat >expected <<-EOF &&\n \t\t${HC}\"nested \\\"unusual\\\" pathname\":unusual\n \t\tEOF\n@@ -545,7 +545,7 @@ do\n \t\ttest_cmp expected actual\n \t'\n \n-\ttest_expect_success FUNNYNAMES \"grep -z $L with unusual pathnames\" '\n+\ttest_expect_success FS_NAME_QUOTE \"grep -z $L with unusual pathnames\" '\n \t\tcat >expected <<-EOF &&\n \t\t${HC}\"unusual\" pathname:unusual\n \t\t${HC}t/nested \"unusual\" pathname:unusual\n@@ -555,7 +555,7 @@ do\n \t\ttest_cmp expected actual-replace-null\n \t'\n \n-\ttest_expect_success FUNNYNAMES \"grep -z $L in subdir with unusual relative pathnames\" '\n+\ttest_expect_success FS_NAME_QUOTE \"grep -z $L in subdir with unusual relative pathnames\" '\n \t\tcat >expected <<-EOF &&\n \t\t${HC}nested \"unusual\" pathname:unusual\n \t\tEOF\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex bbd513bab0f..014f822a089 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -66,11 +66,11 @@ test_expect_success 'prompt - unborn branch' '\n \ttest_cmp expected \"$actual\"\n '\n \n-if test_have_prereq !FUNNYNAMES; then\n+if test_have_prereq !FS_NAME_NEWLINE; then\n \tsay 'Your filesystem does not allow newlines in filenames.'\n fi\n \n-test_expect_success FUNNYNAMES 'prompt - with newline in path' '\n+test_expect_success FS_NAME_NEWLINE 'prompt - with newline in path' '\n     repo_with_newline=\"repo\n with\n newline\" &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 531cef097db..3b2fcd8afdf 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1700,20 +1700,29 @@ test_lazy_prereq CASE_INSENSITIVE_FS '\n \ttest \"$(cat CamelCase)\" != good\n '\n \n-test_lazy_prereq FUNNYNAMES '\n-\ttest_have_prereq !MINGW &&\n-\ttouch -- \\\n-\t\t\"FUNNYNAMES tab\tembedded\" \\\n-\t\t\"FUNNYNAMES \\\"quote embedded\\\"\" \\\n-\t\t\"FUNNYNAMES newline\n+test_lazy_prereq FS_NAME_TAB '\n+\ttouch -- \"FUNNYNAMES tab\tembedded\" 2>/dev/null &&\n+\trm -- \"FUNNYNAMES tab\tembedded\"  2>/dev/null\n+'\n+test_lazy_prereq FS_NAME_QUOTE '\n+\ttouch -- \"FUNNYNAMES \\\"quote embedded\\\"\" 2>/dev/null &&\n+\trm -- \"FUNNYNAMES \\\"quote embedded\\\"\"  2>/dev/null\n+'\n+test_lazy_prereq FS_NAME_NEWLINE '\n+\ttouch -- \"FUNNYNAMES newline\n embedded\" 2>/dev/null &&\n-\trm -- \\\n-\t\t\"FUNNYNAMES tab\tembedded\" \\\n-\t\t\"FUNNYNAMES \\\"quote embedded\\\"\" \\\n-\t\t\"FUNNYNAMES newline\n+\trm -- \"FUNNYNAMES newline\n embedded\" 2>/dev/null\n '\n \n+# Please use a more specific FS_NAME_* check if possible.\n+test_lazy_prereq FUNNYNAMES '\n+\ttest_have_prereq !MINGW &&\n+\ttest_have_prereq FS_NAME_TAB &&\n+\ttest_have_prereq FS_NAME_QUOTE &&\n+\ttest_have_prereq FS_NAME_NEWLINE\n+'\n+\n test_lazy_prereq UTF8_NFD_TO_NFC '\n \t# check whether FS converts nfd unicode to nfc\n \tauml=$(printf \"\\303\\244\")\n"},{"id":"453369","messageId":"20220409153626.qqn23c7vsw4ftges@lucy.dinwoodie.org","threadId":"57695","inReplyTo":"220408.86v8vjbzen.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH] t9902: split test to run on appropriate systems","fromName":"Adam Dinwoodie","fromEmail":"adam@dinwoodie.org","sentAt":"2022-04-09T15:36:26Z","receivedAt":"2022-04-09T15:36:37Z","isPatch":true,"sender":{"key":"adam@dinwoodie.org","avatar":"https://avatars.githubusercontent.com/u/1397507?v=4"},"body":"On Fri, Apr 08, 2022 at 12:56:30PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> \n> On Fri, Apr 08 2022, Adam Dinwoodie wrote:\n> \n> > The \"FUNNYNAMES\" test prerequisite passes on Cygwin, as the Cygwin\n> > file system interface has a workaround for the underlying operating\n> > system's lack of support for tabs, newlines or quotes.  However, it does\n> > not add support for backslash, which is treated as a directory\n> > separator, meaning one of the tests added by 48803821b1 (\"completion:\n> > handle unusual characters for sparse-checkout\", 2022-02-07) will fail on\n> > Cygwin.\n> >\n> > To avoid this failure while still getting maximal test coverage, split\n> > that test into two: test handling of paths that include tabs on anything\n> > that has the FUNNYNAMES prerequisite, but skip testing handling of paths\n> > that include backslashes unless both FUNNYNAMES is set and the system is\n> > not Cygwin.\n> >\n> > It might be nice to have more granularity than \"FUNNYNAMES\" and its\n> > sibling \"FUNNIERNAMES\" provide, so that tests could be run based on\n> > specific individual characters supported by the file system being\n> > tested, but that seems like it would make the prerequisite checks in\n> > this area much more verbose for very little gain.\n> \n> For getting the release out the door this seems like a sensible isolated\n> fix, but I don't see why we wouldn't get more granularity here,\n> i.e. something like the below.\n> \n> I converted all the straightforward cases, where these tests were either\n> a bit misleading, or we'd actually skip testing on some systems\n> needlessly e.g. if they supported \\t in a name but not \\n.\n> \n> This leaves only 8 remaining cases of FUNNYNAMES, all of those similarly\n> seem like subtle potential issues. I.e. we're creating files with\n> characters like \"?\" or \"*\" in the name.\n> \n> But the prerequisite never checks for that, we're just implicitly\n> assuming that a FS that can do [\\t\\n\"] an also do [*?+] or whatever.\n> \n> In the case of the \"rm\" test we'd unconditionally create a file with a\n> space in its name, but then conditional on FUNNYNAMES remove it.\n> \n> diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\n> index e74a318ac33..7714fc4852f 100755\n> --- a/t/t3600-rm.sh\n> +++ b/t/t3600-rm.sh\n> @@ -17,12 +17,7 @@ test_expect_success 'Initialize test directory' '\n>  \tgit commit -m \"add normal files\"\n>  '\n>  \n> -if test_have_prereq !FUNNYNAMES\n> -then\n> -\tsay 'Your filesystem does not allow tabs in filenames.'\n> -fi\n> -\n> -test_expect_success FUNNYNAMES 'add files with funny names' '\n> +test_expect_success FS_NAME_TAB,FS_NAME_NEWLINE 'add files with funny names' '\n>  \ttouch -- \"tab\tembedded\" \"newline${LF}embedded\" &&\n>  \tgit add -- \"tab\tembedded\" \"newline${LF}embedded\" &&\n>  \tgit commit -m \"add files with tabs and newlines\"\n> @@ -94,8 +89,12 @@ test_expect_success 'Test that \"git rm -- -q\" succeeds (remove a file that looks\n>  \tgit rm -- -q\n>  '\n>  \n> -test_expect_success FUNNYNAMES 'Test that \"git rm -f\" succeeds with embedded space, tab, or newline characters.' '\n> -\tgit rm -f \"space embedded\" \"tab\tembedded\" \"newline${LF}embedded\"\n> +test_expect_success FS_NAME_TAB,FS_NAME_NEWLINE 'Test that \"git rm -f\" succeeds with embedded tab or newline characters.' '\n> +\tgit rm -f \"tab\tembedded\" \"newline${LF}embedded\"\n> +'\n> +\n> +test_expect_success 'Test that \"git rm -f\" succeeds with embedded space.' '\n> +\tgit rm -f \"space embedded\"\n>  '\n>  \n>  test_expect_success SANITY 'Test that \"git rm -f\" fails if its rm fails' '\n> diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh\n> index 9a292bac70c..5dbe688ab10 100755\n> --- a/t/t4038-diff-combined.sh\n> +++ b/t/t4038-diff-combined.sh\n> @@ -482,7 +482,7 @@ test_expect_success '--combined-all-paths and --cc' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names' '\n> +test_expect_success FS_NAME_TAB 'setup for --combined-all-paths with funny names' '\n>  \tgit branch side1d &&\n>  \tgit branch side2d &&\n>  \tgit checkout side1d &&\n> @@ -507,7 +507,7 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'\n>  \thead=$(git rev-parse HEAD)\n>  '\n>  \n> -test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names' '\n> +test_expect_success FS_NAME_TAB '--combined-all-paths and --raw and funny names' '\n>  \tcat <<-EOF >expect &&\n>  \t::100644 100644 100644 $side1df $side2df $headf RR\t\"file\\twith\\ttabs\"\t\"i\\tam\\ttabbed\"\t\"fickle\\tnaming\"\n>  \tEOF\n> @@ -516,13 +516,13 @@ test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names'\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success FUNNYNAMES '--combined-all-paths and --raw -and -z and funny names' '\n> +test_expect_success FS_NAME_TAB '--combined-all-paths and --raw -and -z and funny names' '\n>  \tprintf \"$head\\0::100644 100644 100644 $side1df $side2df $headf RR\\0file\\twith\\ttabs\\0i\\tam\\ttabbed\\0fickle\\tnaming\\0\" >expect &&\n>  \tgit diff-tree -c -M --raw --combined-all-paths -z HEAD >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success FUNNYNAMES '--combined-all-paths and --cc and funny names' '\n> +test_expect_success FS_NAME_TAB '--combined-all-paths and --cc and funny names' '\n>  \tcat <<-\\EOF >expect &&\n>  \t--- \"a/file\\twith\\ttabs\"\n>  \t--- \"a/i\\tam\\ttabbed\"\n> diff --git a/t/t4135-apply-weird-filenames.sh b/t/t4135-apply-weird-filenames.sh\n> index 6bc3fb97a75..582666c691b 100755\n> --- a/t/t4135-apply-weird-filenames.sh\n> +++ b/t/t4135-apply-weird-filenames.sh\n> @@ -53,9 +53,9 @@ try_filename() {\n>  \n>  try_filename 'plain'            'postimage.txt'\n>  try_filename 'with spaces'      'post image.txt'\n> -try_filename 'with tab'         'post\timage.txt' FUNNYNAMES\n> +try_filename 'with tab'         'post\timage.txt' FS_NAME_TAB\n>  try_filename 'with backslash'   'post\\image.txt' BSLASHPSPEC\n> -try_filename 'with quote'       '\"postimage\".txt' FUNNYNAMES success failure success\n> +try_filename 'with quote'       '\"postimage\".txt' FS_NAME_QUOTE success failure success\n>  \n>  test_expect_success 'whitespace-damaged traditional patch' '\n>  \techo postimage >expected &&\n> diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\n> index 69356011713..5b880552a05 100755\n> --- a/t/t7810-grep.sh\n> +++ b/t/t7810-grep.sh\n> @@ -82,7 +82,7 @@ test_expect_success setup '\n>  \t# Still a no-op.\n>  \tfunction dummy() {}\n>  \tEOF\n> -\tif test_have_prereq FUNNYNAMES\n> +\tif test_have_prereq FS_NAME_QUOTE\n>  \tthen\n>  \t\techo unusual >\"\\\"unusual\\\" pathname\" &&\n>  \t\techo unusual >\"t/nested \\\"unusual\\\" pathname\"\n> @@ -525,7 +525,7 @@ do\n>  \t\ttest_cmp expected actual\n>  \t'\n>  \n> -\ttest_expect_success FUNNYNAMES \"grep $L should quote unusual pathnames\" '\n> +\ttest_expect_success FS_NAME_QUOTE \"grep $L should quote unusual pathnames\" '\n>  \t\tcat >expected <<-EOF &&\n>  \t\t${HC}\"\\\"unusual\\\" pathname\":unusual\n>  \t\t${HC}\"t/nested \\\"unusual\\\" pathname\":unusual\n> @@ -534,7 +534,7 @@ do\n>  \t\ttest_cmp expected actual\n>  \t'\n>  \n> -\ttest_expect_success FUNNYNAMES \"grep $L in subdir should quote unusual relative pathnames\" '\n> +\ttest_expect_success FS_NAME_QUOTE \"grep $L in subdir should quote unusual relative pathnames\" '\n>  \t\tcat >expected <<-EOF &&\n>  \t\t${HC}\"nested \\\"unusual\\\" pathname\":unusual\n>  \t\tEOF\n> @@ -545,7 +545,7 @@ do\n>  \t\ttest_cmp expected actual\n>  \t'\n>  \n> -\ttest_expect_success FUNNYNAMES \"grep -z $L with unusual pathnames\" '\n> +\ttest_expect_success FS_NAME_QUOTE \"grep -z $L with unusual pathnames\" '\n>  \t\tcat >expected <<-EOF &&\n>  \t\t${HC}\"unusual\" pathname:unusual\n>  \t\t${HC}t/nested \"unusual\" pathname:unusual\n> @@ -555,7 +555,7 @@ do\n>  \t\ttest_cmp expected actual-replace-null\n>  \t'\n>  \n> -\ttest_expect_success FUNNYNAMES \"grep -z $L in subdir with unusual relative pathnames\" '\n> +\ttest_expect_success FS_NAME_QUOTE \"grep -z $L in subdir with unusual relative pathnames\" '\n>  \t\tcat >expected <<-EOF &&\n>  \t\t${HC}nested \"unusual\" pathname:unusual\n>  \t\tEOF\n> diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\n> index bbd513bab0f..014f822a089 100755\n> --- a/t/t9903-bash-prompt.sh\n> +++ b/t/t9903-bash-prompt.sh\n> @@ -66,11 +66,11 @@ test_expect_success 'prompt - unborn branch' '\n>  \ttest_cmp expected \"$actual\"\n>  '\n>  \n> -if test_have_prereq !FUNNYNAMES; then\n> +if test_have_prereq !FS_NAME_NEWLINE; then\n>  \tsay 'Your filesystem does not allow newlines in filenames.'\n>  fi\n>  \n> -test_expect_success FUNNYNAMES 'prompt - with newline in path' '\n> +test_expect_success FS_NAME_NEWLINE 'prompt - with newline in path' '\n>      repo_with_newline=\"repo\n>  with\n>  newline\" &&\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 531cef097db..3b2fcd8afdf 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1700,20 +1700,29 @@ test_lazy_prereq CASE_INSENSITIVE_FS '\n>  \ttest \"$(cat CamelCase)\" != good\n>  '\n>  \n> -test_lazy_prereq FUNNYNAMES '\n> -\ttest_have_prereq !MINGW &&\n> -\ttouch -- \\\n> -\t\t\"FUNNYNAMES tab\tembedded\" \\\n> -\t\t\"FUNNYNAMES \\\"quote embedded\\\"\" \\\n> -\t\t\"FUNNYNAMES newline\n> +test_lazy_prereq FS_NAME_TAB '\n> +\ttouch -- \"FUNNYNAMES tab\tembedded\" 2>/dev/null &&\n> +\trm -- \"FUNNYNAMES tab\tembedded\"  2>/dev/null\n> +'\n> +test_lazy_prereq FS_NAME_QUOTE '\n> +\ttouch -- \"FUNNYNAMES \\\"quote embedded\\\"\" 2>/dev/null &&\n> +\trm -- \"FUNNYNAMES \\\"quote embedded\\\"\"  2>/dev/null\n> +'\n> +test_lazy_prereq FS_NAME_NEWLINE '\n> +\ttouch -- \"FUNNYNAMES newline\n>  embedded\" 2>/dev/null &&\n> -\trm -- \\\n> -\t\t\"FUNNYNAMES tab\tembedded\" \\\n> -\t\t\"FUNNYNAMES \\\"quote embedded\\\"\" \\\n> -\t\t\"FUNNYNAMES newline\n> +\trm -- \"FUNNYNAMES newline\n>  embedded\" 2>/dev/null\n>  '\n>  \n> +# Please use a more specific FS_NAME_* check if possible.\n> +test_lazy_prereq FUNNYNAMES '\n> +\ttest_have_prereq !MINGW &&\n> +\ttest_have_prereq FS_NAME_TAB &&\n> +\ttest_have_prereq FS_NAME_QUOTE &&\n> +\ttest_have_prereq FS_NAME_NEWLINE\n> +'\n> +\n>  test_lazy_prereq UTF8_NFD_TO_NFC '\n>  \t# check whether FS converts nfd unicode to nfc\n>  \tauml=$(printf \"\\303\\244\")\n\nThat's a significantly neater patch than I was expecting!  I can see\nJunio's added my quick fix for the v2.36.0 rc; what's the process from\nhere in this circumstance?  Wait for v2.36.0 to be released properly,\nthen submit the patches?\n\nFixing t9902 using the same scheme as above adds the diff below, after\napplying the patch above to the v2.36.0-rc1 tag; I've confirmed this\nworks as expected on Cygwin, with the test gated by FS_NAME_TAB passing\nand the test gated by FS_NAME_BACKSLASH being skipped.\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3b2fcd8afd..3e4ca53f61 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1714,6 +1714,10 @@ embedded\" 2>/dev/null &&\n \trm -- \"FUNNYNAMES newline\n embedded\" 2>/dev/null\n '\n+test_lazy_prereq FS_NAME_BACKSLASH '\n+\ttouch -- \"FUNNYNAMES backslash\\\\embedded\" 2>/dev/null &&\n+\trm -- \"FUNNYNAMES backslash\\\\embedded\" 2>/dev/null\n+'\n \n # Please use a more specific FS_NAME_* check if possible.\n test_lazy_prereq FUNNYNAMES '\ndiff --git a/t/t9902-completion.sh b/t/t9902-completion.sh\nindex 31526e6b64..4a3771e914 100755\n--- a/t/t9902-completion.sh\n+++ b/t/t9902-completion.sh\n@@ -1529,8 +1529,7 @@ test_expect_success 'cone mode sparse-checkout completes directory names with sp\n \t)\n '\n \n-# use FUNNYNAMES to avoid running on Windows, which doesn't permit tabs in paths\n-test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory names with tabs' '\n+test_expect_success FS_NAME_TAB 'cone mode sparse-checkout completes directory names with tabs' '\n \t# reset sparse-checkout\n \tgit -C sparse-checkout sparse-checkout disable &&\n \t(\n@@ -1550,8 +1549,7 @@ test_expect_success FUNNYNAMES 'cone mode sparse-checkout completes directory na\n \t)\n '\n \n-# use FUNNYNAMES to avoid running on Windows, and !CYGWIN for Cygwin, as neither permit backslashes in paths\n-test_expect_success FUNNYNAMES,!CYGWIN 'cone mode sparse-checkout completes directory names with backslashes' '\n+test_expect_success FS_NAME_BACKSLASH 'cone mode sparse-checkout completes directory names with backslashes' '\n \t# reset sparse-checkout\n \tgit -C sparse-checkout sparse-checkout disable &&\n \t(\n"},{"id":"454722","messageId":"20220502144610.fyxns33cfrpa5gsy@lucy.dinwoodie.org","threadId":"57695","inReplyTo":"20220409153626.qqn23c7vsw4ftges@lucy.dinwoodie.org","subject":"Re: [PATCH] t9902: split test to run on appropriate systems","fromName":"Adam Dinwoodie","fromEmail":"adam@dinwoodie.org","sentAt":"2022-05-02T14:46:10Z","receivedAt":"2022-05-02T15:03:08Z","isPatch":true,"sender":{"key":"adam@dinwoodie.org","avatar":"https://avatars.githubusercontent.com/u/1397507?v=4"},"body":"On Sat, Apr 09, 2022 at 04:36:26PM +0100, Adam Dinwoodie wrote:\n> On Fri, Apr 08, 2022 at 12:56:30PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> > \n> > <snip>\n> > \n> > I converted all the straightforward cases, where these tests were either\n> > a bit misleading, or we'd actually skip testing on some systems\n> > needlessly e.g. if they supported \\t in a name but not \\n.\n> > \n> > This leaves only 8 remaining cases of FUNNYNAMES, all of those similarly\n> > seem like subtle potential issues. I.e. we're creating files with\n> > characters like \"?\" or \"*\" in the name.\n> > \n> > But the prerequisite never checks for that, we're just implicitly\n> > assuming that a FS that can do [\\t\\n\"] an also do [*?+] or whatever.\n> > \n> > In the case of the \"rm\" test we'd unconditionally create a file with a\n> > space in its name, but then conditional on FUNNYNAMES remove it.\n> > \n> > <snip>\n> \n> That's a significantly neater patch than I was expecting!  I can see\n> Junio's added my quick fix for the v2.36.0 rc; what's the process from\n> here in this circumstance?  Wait for v2.36.0 to be released properly,\n> then submit the patches?\n> \n> Fixing t9902 using the same scheme as above adds the diff below, after\n> applying the patch above to the v2.36.0-rc1 tag; I've confirmed this\n> works as expected on Cygwin, with the test gated by FS_NAME_TAB passing\n> and the test gated by FS_NAME_BACKSLASH being skipped.\n> \n> <snip>\n\nÆvar, are you able to submit your patch here to provide the better\nlong-term fix?  Once you've submitted your signed-off version, I can\nsubmit the t9902-specific changes on top, or I'm happy for you to just\nintegrate them into your commit if that's easier.\n"}]}