{"thread":{"id":"63567","subject":"v2.25.0-rc0 test failure on cygwin","startedAt":"2025-06-02T22:36:28Z","lastAt":"2025-06-03T19:06:51Z","messageCount":6,"participants":["Ramsay Jones","Kristoffer Haugsbakk","JAYATHEERTH K","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"519513","messageId":"771677b1-2ce5-40ce-a704-752ff57ba0d3@ramsayjones.plus.com","threadId":"63567","inReplyTo":null,"subject":"v2.25.0-rc0 test failure on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-06-02T22:33:18Z","receivedAt":"2025-06-02T22:36:28Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nI noticed on Friday, while testing the v2.25.0-rc0 build, that test t6137\nfailed on cygwin:\n\n  $ tail test-out-2-50-rc0 \n  Test Summary Report\n  -------------------\n  t6137-pathspec-wildcards-literal.sh              (Wstat: 256 (exited 1) Tests: 25 Failed: 11)\n    Failed tests:  2, 7, 9, 11, 14-15, 17, 19, 21, 23, 25\n    Non-zero exit status: 1\n  Files=1023, Tests=30946, 21783 wallclock secs (19.08 usr 42.17 sys + 4031.65 cusr 12965.78 csys = 17058.68 CPU)\n  Result: FAIL\n  make[1]: *** [Makefile:78: prove] Error 1\n  make[1]: Leaving directory '/home/ramsay/git/t'\n  make: *** [Makefile:3286: test] Error 2\n  $ \n\nA quick squint at the failing tests made it clear that the failure was\ncaused by the cygwin build treating a quoted glob character sequence\n(e.g. '\\*') as a directory separator char followed by a glob character.\n\nTo show this, I quickly hacked up a patch which causes the test to pass:\n\n\n  diff --git a/abspath.h b/abspath.h\n  index 4653080d5e..a5e30a3033 100644\n  --- a/abspath.h\n  +++ b/abspath.h\n  @@ -27,7 +27,7 @@ char *prefix_filename_except_for_dash(const char *prefix, const char *path);\n   \n   static inline int is_absolute_path(const char *path)\n   {\n  -\treturn is_dir_sep(path[0]) || has_dos_drive_prefix(path);\n  +\treturn /*is_dir_sep(path[0])*/ path[0] == '/' || has_dos_drive_prefix(path);\n   }\n   \n   /**\n  diff --git a/path.c b/path.c\n  index 3b598b2847..f000b9ffff 100644\n  --- a/path.c\n  +++ b/path.c\n  @@ -1223,13 +1223,15 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n   \tend = src + offset_1st_component(src);\n   \twhile (src < end) {\n   \t\tchar c = *src++;\n  +#ifdef DUMMY\n   \t\tif (is_dir_sep(c))\n   \t\t\tc = '/';\n  +#endif\n   \t\t*dst++ = c;\n   \t}\n   \tdst0 = dst;\n   \n  -\twhile (is_dir_sep(*src))\n  +\twhile (/*is_dir_sep(*src)*/ *src == '/')\n   \t\tsrc++;\n   \n   \tfor (;;) {\n  @@ -1247,10 +1249,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n   \t\t\tif (!src[1]) {\n   \t\t\t\t/* (1) */\n   \t\t\t\tsrc++;\n  -\t\t\t} else if (is_dir_sep(src[1])) {\n  +\t\t\t} else if (/*is_dir_sep(src[1])*/ src[1] == '/') {\n   \t\t\t\t/* (2) */\n   \t\t\t\tsrc += 2;\n  -\t\t\t\twhile (is_dir_sep(*src))\n  +\t\t\t\twhile (/*is_dir_sep(*src)*/ *src == '/')\n   \t\t\t\t\tsrc++;\n   \t\t\t\tcontinue;\n   \t\t\t} else if (src[1] == '.') {\n  @@ -1258,10 +1260,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n   \t\t\t\t\t/* (3) */\n   \t\t\t\t\tsrc += 2;\n   \t\t\t\t\tgoto up_one;\n  -\t\t\t\t} else if (is_dir_sep(src[2])) {\n  +\t\t\t\t} else if (/*is_dir_sep(src[2])*/ src[2] == '/') {\n   \t\t\t\t\t/* (4) */\n   \t\t\t\t\tsrc += 3;\n  -\t\t\t\t\twhile (is_dir_sep(*src))\n  +\t\t\t\t\twhile (/*is_dir_sep(*src)*/ *src == '/')\n   \t\t\t\t\t\tsrc++;\n   \t\t\t\t\tgoto up_one;\n   \t\t\t\t}\n  @@ -1269,11 +1271,11 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n   \t\t}\n   \n   \t\t/* copy up to the next '/', and eat all '/' */\n  -\t\twhile ((c = *src++) != '\\0' && !is_dir_sep(c))\n  +\t\twhile ((c = *src++) != '\\0' && !(/*is_dir_sep(c)*/ c == '/'))\n   \t\t\t*dst++ = c;\n  -\t\tif (is_dir_sep(c)) {\n  +\t\tif (/*is_dir_sep(c)*/ c == '/') {\n   \t\t\t*dst++ = '/';\n  -\t\t\twhile (is_dir_sep(c))\n  +\t\t\twhile (/*is_dir_sep(c)*/ c == '/')\n   \t\t\t\tc = *src++;\n   \t\t\tsrc--;\n   \t\t} else if (!c)\n\nIn other words, in 'is_absolute_path()' and 'normalize_path_copy_len()', then\njust disable the '\\' character as a path separator! ;)\n\nThis was just to demonstrate the problem, not a serious patch, of course!\n\nI was away for the weekend and was expecting to see a patch to fix this\non Gfw when I got back, but to my surprise there has been no mention of\nit on the mailing list (having now waded through the backlog!).\n\nTo be clear, I can not imagine that this test passes on Gfw. However, this\nshould have been failing the windows CI for ages, so ... perhaps I don't\nhave a sufficiently vivid imagination. :)\n\nAnyway, the patch below 'fixes' the issue on cygwin.\n\nThanks.\n\nATB,\nRamsay Jones\n\n\n---- >8 ----\nFrom: Ramsay Jones <ramsay@ramsayjones.plus.com>\nDate: Mon, 2 Jun 2025 22:51:33 +0100\nSubject: [PATCH] t6137: disable 'quoted glob' pathspecs on cygwin\n\nThe backslash in a 'quoted glob' character is treated as a directory\nseparator character on cygwin, which causes all such tests to fail.\nSkip all such tests on cygwin using the !CYGWIN prerequisite. While\nhere, fix a few test titles as well.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n t/t6137-pathspec-wildcards-literal.sh | 24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t6137-pathspec-wildcards-literal.sh b/t/t6137-pathspec-wildcards-literal.sh\nindex 20abad5667..229e48282e 100755\n--- a/t/t6137-pathspec-wildcards-literal.sh\n+++ b/t/t6137-pathspec-wildcards-literal.sh\n@@ -39,7 +39,7 @@ test_expect_success 'add wildcard *' '\n \t)\n '\n \n-test_expect_success 'add literal \\*' '\n+test_expect_success !CYGWIN 'add literal \\*' '\n \tgit init test-asterisk-literal &&\n \t(\n \t\tcd test-asterisk-literal &&\n@@ -125,7 +125,7 @@ test_expect_success 'add wildcard f*' '\n \t)\n '\n \n-test_expect_success 'add literal f\\*' '\n+test_expect_success !CYGWIN 'add literal f\\*' '\n \tgit init test-f-lit &&\n \t(\n \t\tcd test-f-lit &&\n@@ -156,7 +156,7 @@ test_expect_success 'add wildcard f**' '\n \t)\n '\n \n-test_expect_success 'add literal f\\*\\*' '\n+test_expect_success !CYGWIN 'add literal f\\*\\*' '\n \tgit init test-fdstar-lit &&\n \t(\n \t\tcd test-fdstar-lit &&\n@@ -184,7 +184,7 @@ test_expect_success 'add wildcard f?z' '\n \t)\n '\n \n-test_expect_success 'add literal \\? literal' '\n+test_expect_success !CYGWIN 'add literal \\? literal' '\n \tgit init test-q-lit &&\n \t(\n \t\tcd test-q-lit &&\n@@ -227,7 +227,7 @@ test_expect_success 'add wildcard hello?world' '\n \t)\n '\n \n-test_expect_success 'add literal hello\\?world' '\n+test_expect_success !CYGWIN 'add literal hello\\?world' '\n \tgit init test-hellolit &&\n \t(\n \t\tcd test-hellolit &&\n@@ -241,7 +241,7 @@ test_expect_success 'add literal hello\\?world' '\n \t)\n '\n \n-test_expect_success 'add literal [abc]' '\n+test_expect_success !CYGWIN 'add literal \\[abc\\]' '\n \tgit init test-brackets-lit &&\n \t(\n \t\tcd test-brackets-lit &&\n@@ -280,7 +280,7 @@ test_expect_success 'commit: wildcard *' '\n \t)\n '\n \n-test_expect_success 'commit: literal *' '\n+test_expect_success !CYGWIN 'commit: literal \\*' '\n \tgit init test-c-asterisk-lit &&\n \t(\n \t\tcd test-c-asterisk-lit &&\n@@ -313,7 +313,7 @@ test_expect_success 'commit: wildcard f*' '\n \t)\n '\n \n-test_expect_success 'commit: literal f\\*' '\n+test_expect_success !CYGWIN 'commit: literal f\\*' '\n \tgit init test-c-flit &&\n \t(\n \t\tcd test-c-flit &&\n@@ -328,7 +328,7 @@ test_expect_success 'commit: literal f\\*' '\n \t)\n '\n \n-test_expect_success 'commit: wildcard pathspec limits commit' '\n+test_expect_success 'commit: wildcard f**' '\n \tgit init test-c-pathlimit &&\n \t(\n \t\tcd test-c-pathlimit &&\n@@ -346,7 +346,7 @@ test_expect_success 'commit: wildcard pathspec limits commit' '\n \t)\n '\n \n-test_expect_success 'commit: literal f\\*\\*' '\n+test_expect_success !CYGWIN 'commit: literal f\\*\\*' '\n \tgit init test-c-fdstar-lit &&\n \t(\n \t\tcd test-c-fdstar-lit &&\n@@ -379,7 +379,7 @@ test_expect_success 'commit: wildcard ?' '\n \t)\n '\n \n-test_expect_success 'commit: literal \\?' '\n+test_expect_success !CYGWIN 'commit: literal \\?' '\n \tgit init test-c-qlit &&\n \t(\n \t\tcd test-c-qlit &&\n@@ -411,7 +411,7 @@ test_expect_success 'commit: wildcard hello?world' '\n \t)\n '\n \n-test_expect_success 'commit: literal hello\\?world' '\n+test_expect_success !CYGWIN 'commit: literal hello\\?world' '\n \tgit init test-c-hellolit &&\n \t(\n \t\tcd test-c-hellolit &&\n-- \n2.49.0\n"},{"id":"519514","messageId":"d124a48a-56c6-43ab-8d10-0f6374149213@ramsayjones.plus.com","threadId":"63567","inReplyTo":"771677b1-2ce5-40ce-a704-752ff57ba0d3@ramsayjones.plus.com","subject":"Re: v2.25.0-rc0 test failure on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-06-02T22:48:02Z","receivedAt":"2025-06-02T22:48:05Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Heh, so the subject and ...\n\nOn 02/06/2025 23:33, Ramsay Jones wrote:\n> \n> I noticed on Friday, while testing the v2.25.0-rc0 build, that test t6137\n\n.. this should read v2.50.0-rc0. Hmm ...\n\nATB,\nRamsay Jones\n\n> failed on cygwin:\n> \n>   $ tail test-out-2-50-rc0 \n>   Test Summary Report\n>   -------------------\n>   t6137-pathspec-wildcards-literal.sh              (Wstat: 256 (exited 1) Tests: 25 Failed: 11)\n>     Failed tests:  2, 7, 9, 11, 14-15, 17, 19, 21, 23, 25\n>     Non-zero exit status: 1\n>   Files=1023, Tests=30946, 21783 wallclock secs (19.08 usr 42.17 sys + 4031.65 cusr 12965.78 csys = 17058.68 CPU)\n>   Result: FAIL\n>   make[1]: *** [Makefile:78: prove] Error 1\n>   make[1]: Leaving directory '/home/ramsay/git/t'\n>   make: *** [Makefile:3286: test] Error 2\n>   $ \n> \n> A quick squint at the failing tests made it clear that the failure was\n> caused by the cygwin build treating a quoted glob character sequence\n> (e.g. '\\*') as a directory separator char followed by a glob character.\n> \n> To show this, I quickly hacked up a patch which causes the test to pass:\n> \n> \n>   diff --git a/abspath.h b/abspath.h\n>   index 4653080d5e..a5e30a3033 100644\n>   --- a/abspath.h\n>   +++ b/abspath.h\n>   @@ -27,7 +27,7 @@ char *prefix_filename_except_for_dash(const char *prefix, const char *path);\n>    \n>    static inline int is_absolute_path(const char *path)\n>    {\n>   -\treturn is_dir_sep(path[0]) || has_dos_drive_prefix(path);\n>   +\treturn /*is_dir_sep(path[0])*/ path[0] == '/' || has_dos_drive_prefix(path);\n>    }\n>    \n>    /**\n>   diff --git a/path.c b/path.c\n>   index 3b598b2847..f000b9ffff 100644\n>   --- a/path.c\n>   +++ b/path.c\n>   @@ -1223,13 +1223,15 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>    \tend = src + offset_1st_component(src);\n>    \twhile (src < end) {\n>    \t\tchar c = *src++;\n>   +#ifdef DUMMY\n>    \t\tif (is_dir_sep(c))\n>    \t\t\tc = '/';\n>   +#endif\n>    \t\t*dst++ = c;\n>    \t}\n>    \tdst0 = dst;\n>    \n>   -\twhile (is_dir_sep(*src))\n>   +\twhile (/*is_dir_sep(*src)*/ *src == '/')\n>    \t\tsrc++;\n>    \n>    \tfor (;;) {\n>   @@ -1247,10 +1249,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>    \t\t\tif (!src[1]) {\n>    \t\t\t\t/* (1) */\n>    \t\t\t\tsrc++;\n>   -\t\t\t} else if (is_dir_sep(src[1])) {\n>   +\t\t\t} else if (/*is_dir_sep(src[1])*/ src[1] == '/') {\n>    \t\t\t\t/* (2) */\n>    \t\t\t\tsrc += 2;\n>   -\t\t\t\twhile (is_dir_sep(*src))\n>   +\t\t\t\twhile (/*is_dir_sep(*src)*/ *src == '/')\n>    \t\t\t\t\tsrc++;\n>    \t\t\t\tcontinue;\n>    \t\t\t} else if (src[1] == '.') {\n>   @@ -1258,10 +1260,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>    \t\t\t\t\t/* (3) */\n>    \t\t\t\t\tsrc += 2;\n>    \t\t\t\t\tgoto up_one;\n>   -\t\t\t\t} else if (is_dir_sep(src[2])) {\n>   +\t\t\t\t} else if (/*is_dir_sep(src[2])*/ src[2] == '/') {\n>    \t\t\t\t\t/* (4) */\n>    \t\t\t\t\tsrc += 3;\n>   -\t\t\t\t\twhile (is_dir_sep(*src))\n>   +\t\t\t\t\twhile (/*is_dir_sep(*src)*/ *src == '/')\n>    \t\t\t\t\t\tsrc++;\n>    \t\t\t\t\tgoto up_one;\n>    \t\t\t\t}\n>   @@ -1269,11 +1271,11 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>    \t\t}\n>    \n>    \t\t/* copy up to the next '/', and eat all '/' */\n>   -\t\twhile ((c = *src++) != '\\0' && !is_dir_sep(c))\n>   +\t\twhile ((c = *src++) != '\\0' && !(/*is_dir_sep(c)*/ c == '/'))\n>    \t\t\t*dst++ = c;\n>   -\t\tif (is_dir_sep(c)) {\n>   +\t\tif (/*is_dir_sep(c)*/ c == '/') {\n>    \t\t\t*dst++ = '/';\n>   -\t\t\twhile (is_dir_sep(c))\n>   +\t\t\twhile (/*is_dir_sep(c)*/ c == '/')\n>    \t\t\t\tc = *src++;\n>    \t\t\tsrc--;\n>    \t\t} else if (!c)\n> \n> In other words, in 'is_absolute_path()' and 'normalize_path_copy_len()', then\n> just disable the '\\' character as a path separator! ;)\n> \n> This was just to demonstrate the problem, not a serious patch, of course!\n> \n> I was away for the weekend and was expecting to see a patch to fix this\n> on Gfw when I got back, but to my surprise there has been no mention of\n> it on the mailing list (having now waded through the backlog!).\n> \n> To be clear, I can not imagine that this test passes on Gfw. However, this\n> should have been failing the windows CI for ages, so ... perhaps I don't\n> have a sufficiently vivid imagination. :)\n> \n> Anyway, the patch below 'fixes' the issue on cygwin.\n> \n> Thanks.\n> \n> ATB,\n> Ramsay Jones\n> \n> \n> ---- >8 ----\n> From: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> Date: Mon, 2 Jun 2025 22:51:33 +0100\n> Subject: [PATCH] t6137: disable 'quoted glob' pathspecs on cygwin\n> \n> The backslash in a 'quoted glob' character is treated as a directory\n> separator character on cygwin, which causes all such tests to fail.\n> Skip all such tests on cygwin using the !CYGWIN prerequisite. While\n> here, fix a few test titles as well.\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>  t/t6137-pathspec-wildcards-literal.sh | 24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n> \n> diff --git a/t/t6137-pathspec-wildcards-literal.sh b/t/t6137-pathspec-wildcards-literal.sh\n> index 20abad5667..229e48282e 100755\n> --- a/t/t6137-pathspec-wildcards-literal.sh\n> +++ b/t/t6137-pathspec-wildcards-literal.sh\n> @@ -39,7 +39,7 @@ test_expect_success 'add wildcard *' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal \\*' '\n> +test_expect_success !CYGWIN 'add literal \\*' '\n>  \tgit init test-asterisk-literal &&\n>  \t(\n>  \t\tcd test-asterisk-literal &&\n> @@ -125,7 +125,7 @@ test_expect_success 'add wildcard f*' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal f\\*' '\n> +test_expect_success !CYGWIN 'add literal f\\*' '\n>  \tgit init test-f-lit &&\n>  \t(\n>  \t\tcd test-f-lit &&\n> @@ -156,7 +156,7 @@ test_expect_success 'add wildcard f**' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal f\\*\\*' '\n> +test_expect_success !CYGWIN 'add literal f\\*\\*' '\n>  \tgit init test-fdstar-lit &&\n>  \t(\n>  \t\tcd test-fdstar-lit &&\n> @@ -184,7 +184,7 @@ test_expect_success 'add wildcard f?z' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal \\? literal' '\n> +test_expect_success !CYGWIN 'add literal \\? literal' '\n>  \tgit init test-q-lit &&\n>  \t(\n>  \t\tcd test-q-lit &&\n> @@ -227,7 +227,7 @@ test_expect_success 'add wildcard hello?world' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal hello\\?world' '\n> +test_expect_success !CYGWIN 'add literal hello\\?world' '\n>  \tgit init test-hellolit &&\n>  \t(\n>  \t\tcd test-hellolit &&\n> @@ -241,7 +241,7 @@ test_expect_success 'add literal hello\\?world' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'add literal [abc]' '\n> +test_expect_success !CYGWIN 'add literal \\[abc\\]' '\n>  \tgit init test-brackets-lit &&\n>  \t(\n>  \t\tcd test-brackets-lit &&\n> @@ -280,7 +280,7 @@ test_expect_success 'commit: wildcard *' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: literal *' '\n> +test_expect_success !CYGWIN 'commit: literal \\*' '\n>  \tgit init test-c-asterisk-lit &&\n>  \t(\n>  \t\tcd test-c-asterisk-lit &&\n> @@ -313,7 +313,7 @@ test_expect_success 'commit: wildcard f*' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: literal f\\*' '\n> +test_expect_success !CYGWIN 'commit: literal f\\*' '\n>  \tgit init test-c-flit &&\n>  \t(\n>  \t\tcd test-c-flit &&\n> @@ -328,7 +328,7 @@ test_expect_success 'commit: literal f\\*' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: wildcard pathspec limits commit' '\n> +test_expect_success 'commit: wildcard f**' '\n>  \tgit init test-c-pathlimit &&\n>  \t(\n>  \t\tcd test-c-pathlimit &&\n> @@ -346,7 +346,7 @@ test_expect_success 'commit: wildcard pathspec limits commit' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: literal f\\*\\*' '\n> +test_expect_success !CYGWIN 'commit: literal f\\*\\*' '\n>  \tgit init test-c-fdstar-lit &&\n>  \t(\n>  \t\tcd test-c-fdstar-lit &&\n> @@ -379,7 +379,7 @@ test_expect_success 'commit: wildcard ?' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: literal \\?' '\n> +test_expect_success !CYGWIN 'commit: literal \\?' '\n>  \tgit init test-c-qlit &&\n>  \t(\n>  \t\tcd test-c-qlit &&\n> @@ -411,7 +411,7 @@ test_expect_success 'commit: wildcard hello?world' '\n>  \t)\n>  '\n>  \n> -test_expect_success 'commit: literal hello\\?world' '\n> +test_expect_success !CYGWIN 'commit: literal hello\\?world' '\n>  \tgit init test-c-hellolit &&\n>  \t(\n>  \t\tcd test-c-hellolit &&\n\n"},{"id":"519515","messageId":"7e59a05e-9abe-44e0-b5bb-6bd633570db5@app.fastmail.com","threadId":"63567","inReplyTo":"d124a48a-56c6-43ab-8d10-0f6374149213@ramsayjones.plus.com","subject":"Re: v2.25.0-rc0 test failure on cygwin","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-06-02T22:57:44Z","receivedAt":"2025-06-02T22:58:38Z","isPatch":false,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Tue, Jun 3, 2025, at 00:48, Ramsay Jones wrote:\n> Heh, so the subject and ...\n>\n> On 02/06/2025 23:33, Ramsay Jones wrote:\n>> \n>> I noticed on Friday, while testing the v2.25.0-rc0 build, that test t6137\n>\n> .. this should read v2.50.0-rc0. Hmm ...\n\nWhere does the extra *2* come from‽ ;)\n\nhttps://lore.kernel.org/git/061401dbd2d8$b4ba03a0$1e2e0ae0$@nexbridge.com/\n"},{"id":"519573","messageId":"CA+rGoLcbtYCZ6Jr8YtinTq+KrdJBCv6JgA9+OQ1Hvj0+Yr1Hig@mail.gmail.com","threadId":"63567","inReplyTo":"771677b1-2ce5-40ce-a704-752ff57ba0d3@ramsayjones.plus.com","subject":"Re: v2.25.0-rc0 test failure on cygwin","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-06-03T14:41:42Z","receivedAt":"2025-06-03T14:41:55Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Hi Ramsay,\n\nOn Tue, Jun 3, 2025 at 4:03 AM Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:\n>\n>\n> I noticed on Friday, while testing the v2.25.0-rc0 build, that test t6137\n> failed on cygwin:\n>\n>   $ tail test-out-2-50-rc0\n>   Test Summary Report\n>   -------------------\n>   t6137-pathspec-wildcards-literal.sh              (Wstat: 256 (exited 1) Tests: 25 Failed: 11)\n>     Failed tests:  2, 7, 9, 11, 14-15, 17, 19, 21, 23, 25\n>     Non-zero exit status: 1\n>   Files=1023, Tests=30946, 21783 wallclock secs (19.08 usr 42.17 sys + 4031.65 cusr 12965.78 csys = 17058.68 CPU)\n>   Result: FAIL\n>   make[1]: *** [Makefile:78: prove] Error 1\n>   make[1]: Leaving directory '/home/ramsay/git/t'\n>   make: *** [Makefile:3286: test] Error 2\n>   $\n>\n> A quick squint at the failing tests made it clear that the failure was\n> caused by the cygwin build treating a quoted glob character sequence\n> (e.g. '\\*') as a directory separator char followed by a glob character.\n>\n> To show this, I quickly hacked up a patch which causes the test to pass:\n>\n>\n>   diff --git a/abspath.h b/abspath.h\n>   index 4653080d5e..a5e30a3033 100644\n>   --- a/abspath.h\n>   +++ b/abspath.h\n>   @@ -27,7 +27,7 @@ char *prefix_filename_except_for_dash(const char *prefix, const char *path);\n>\n>    static inline int is_absolute_path(const char *path)\n>    {\n>   -     return is_dir_sep(path[0]) || has_dos_drive_prefix(path);\n>   +     return /*is_dir_sep(path[0])*/ path[0] == '/' || has_dos_drive_prefix(path);\n>    }\n>\n>    /**\n>   diff --git a/path.c b/path.c\n>   index 3b598b2847..f000b9ffff 100644\n>   --- a/path.c\n>   +++ b/path.c\n>   @@ -1223,13 +1223,15 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>         end = src + offset_1st_component(src);\n>         while (src < end) {\n>                 char c = *src++;\n>   +#ifdef DUMMY\n>                 if (is_dir_sep(c))\n>                         c = '/';\n>   +#endif\n>                 *dst++ = c;\n>         }\n>         dst0 = dst;\n>\n>   -     while (is_dir_sep(*src))\n>   +     while (/*is_dir_sep(*src)*/ *src == '/')\n>                 src++;\n>\n>         for (;;) {\n>   @@ -1247,10 +1249,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>                         if (!src[1]) {\n>                                 /* (1) */\n>                                 src++;\n>   -                     } else if (is_dir_sep(src[1])) {\n>   +                     } else if (/*is_dir_sep(src[1])*/ src[1] == '/') {\n>                                 /* (2) */\n>                                 src += 2;\n>   -                             while (is_dir_sep(*src))\n>   +                             while (/*is_dir_sep(*src)*/ *src == '/')\n>                                         src++;\n>                                 continue;\n>                         } else if (src[1] == '.') {\n>   @@ -1258,10 +1260,10 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>                                         /* (3) */\n>                                         src += 2;\n>                                         goto up_one;\n>   -                             } else if (is_dir_sep(src[2])) {\n>   +                             } else if (/*is_dir_sep(src[2])*/ src[2] == '/') {\n>                                         /* (4) */\n>                                         src += 3;\n>   -                                     while (is_dir_sep(*src))\n>   +                                     while (/*is_dir_sep(*src)*/ *src == '/')\n>                                                 src++;\n>                                         goto up_one;\n>                                 }\n>   @@ -1269,11 +1271,11 @@ int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)\n>                 }\n>\n>                 /* copy up to the next '/', and eat all '/' */\n>   -             while ((c = *src++) != '\\0' && !is_dir_sep(c))\n>   +             while ((c = *src++) != '\\0' && !(/*is_dir_sep(c)*/ c == '/'))\n>                         *dst++ = c;\n>   -             if (is_dir_sep(c)) {\n>   +             if (/*is_dir_sep(c)*/ c == '/') {\n>                         *dst++ = '/';\n>   -                     while (is_dir_sep(c))\n>   +                     while (/*is_dir_sep(c)*/ c == '/')\n>                                 c = *src++;\n>                         src--;\n>                 } else if (!c)\n>\n\nHmmm interesting\n\n> In other words, in 'is_absolute_path()' and 'normalize_path_copy_len()', then\n> just disable the '\\' character as a path separator! ;)\n>\n> This was just to demonstrate the problem, not a serious patch, of course!\n>\n> I was away for the weekend and was expecting to see a patch to fix this\n> on Gfw when I got back, but to my surprise there has been no mention of\n> it on the mailing list (having now waded through the backlog!).\n>\n> To be clear, I can not imagine that this test passes on Gfw. However, this\n> should have been failing the windows CI for ages, so ... perhaps I don't\n> have a sufficiently vivid imagination. :)\n>\n> Anyway, the patch below 'fixes' the issue on cygwin.\n>\n> Thanks.\n>\n> ATB,\n> Ramsay Jones\n>\n>\n> ---- >8 ----\n> From: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> Date: Mon, 2 Jun 2025 22:51:33 +0100\n> Subject: [PATCH] t6137: disable 'quoted glob' pathspecs on cygwin\n>\n> The backslash in a 'quoted glob' character is treated as a directory\n> separator character on cygwin, which causes all such tests to fail.\n> Skip all such tests on cygwin using the !CYGWIN prerequisite. While\n> here, fix a few test titles as well.\n>\n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n>  t/t6137-pathspec-wildcards-literal.sh | 24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/t/t6137-pathspec-wildcards-literal.sh b/t/t6137-pathspec-wildcards-literal.sh\n> index 20abad5667..229e48282e 100755\n> --- a/t/t6137-pathspec-wildcards-literal.sh\n> +++ b/t/t6137-pathspec-wildcards-literal.sh\n> @@ -39,7 +39,7 @@ test_expect_success 'add wildcard *' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal \\*' '\n> +test_expect_success !CYGWIN 'add literal \\*' '\n>         git init test-asterisk-literal &&\n>         (\n>                 cd test-asterisk-literal &&\n> @@ -125,7 +125,7 @@ test_expect_success 'add wildcard f*' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal f\\*' '\n> +test_expect_success !CYGWIN 'add literal f\\*' '\n>         git init test-f-lit &&\n>         (\n>                 cd test-f-lit &&\n> @@ -156,7 +156,7 @@ test_expect_success 'add wildcard f**' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal f\\*\\*' '\n> +test_expect_success !CYGWIN 'add literal f\\*\\*' '\n>         git init test-fdstar-lit &&\n>         (\n>                 cd test-fdstar-lit &&\n> @@ -184,7 +184,7 @@ test_expect_success 'add wildcard f?z' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal \\? literal' '\n> +test_expect_success !CYGWIN 'add literal \\? literal' '\n>         git init test-q-lit &&\n>         (\n>                 cd test-q-lit &&\n> @@ -227,7 +227,7 @@ test_expect_success 'add wildcard hello?world' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal hello\\?world' '\n> +test_expect_success !CYGWIN 'add literal hello\\?world' '\n>         git init test-hellolit &&\n>         (\n>                 cd test-hellolit &&\n> @@ -241,7 +241,7 @@ test_expect_success 'add literal hello\\?world' '\n>         )\n>  '\n>\n> -test_expect_success 'add literal [abc]' '\n> +test_expect_success !CYGWIN 'add literal \\[abc\\]' '\n>         git init test-brackets-lit &&\n>         (\n>                 cd test-brackets-lit &&\n> @@ -280,7 +280,7 @@ test_expect_success 'commit: wildcard *' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: literal *' '\n> +test_expect_success !CYGWIN 'commit: literal \\*' '\n>         git init test-c-asterisk-lit &&\n>         (\n>                 cd test-c-asterisk-lit &&\n> @@ -313,7 +313,7 @@ test_expect_success 'commit: wildcard f*' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: literal f\\*' '\n> +test_expect_success !CYGWIN 'commit: literal f\\*' '\n>         git init test-c-flit &&\n>         (\n>                 cd test-c-flit &&\n> @@ -328,7 +328,7 @@ test_expect_success 'commit: literal f\\*' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: wildcard pathspec limits commit' '\n> +test_expect_success 'commit: wildcard f**' '\n>         git init test-c-pathlimit &&\n>         (\n>                 cd test-c-pathlimit &&\n> @@ -346,7 +346,7 @@ test_expect_success 'commit: wildcard pathspec limits commit' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: literal f\\*\\*' '\n> +test_expect_success !CYGWIN 'commit: literal f\\*\\*' '\n>         git init test-c-fdstar-lit &&\n>         (\n>                 cd test-c-fdstar-lit &&\n> @@ -379,7 +379,7 @@ test_expect_success 'commit: wildcard ?' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: literal \\?' '\n> +test_expect_success !CYGWIN 'commit: literal \\?' '\n>         git init test-c-qlit &&\n>         (\n>                 cd test-c-qlit &&\n> @@ -411,7 +411,7 @@ test_expect_success 'commit: wildcard hello?world' '\n>         )\n>  '\n>\n> -test_expect_success 'commit: literal hello\\?world' '\n> +test_expect_success !CYGWIN 'commit: literal hello\\?world' '\n>         git init test-c-hellolit &&\n>         (\n>                 cd test-c-hellolit &&\n> --\n> 2.49.0\n\n\nThis is an interesting breakdown of the problem\nthanks for digging into it.\nJust to clarify :) My change was limited to a minor condition in\n`dir.c` to ensure that `MATCHED_EXACTLY` only proceeds when the\n`nowildcard_len` matches the full pathspec length (i.e., it's a true\nliteral). I didn’t touch the `is_dir_sep()` logic or normalization\nfunctions, so your debug trail really helped surface a side effect I\nhadn’t anticipated.\n\nThat said, I'm more than happy to help work toward a more permanent\nsolution if needed, beyond the `!CYGWIN` skip. Let me know how you'd\nprefer to proceed.\n\n- Jayatheerth\n"},{"id":"519579","messageId":"xmqq5xhcpzyp.fsf@gitster.g","threadId":"63567","inReplyTo":"771677b1-2ce5-40ce-a704-752ff57ba0d3@ramsayjones.plus.com","subject":"Re: v2.25.0-rc0 test failure on cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-06-03T16:11:26Z","receivedAt":"2025-06-03T16:11:30Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n\n> I noticed on Friday, while testing the v2.25.0-rc0 build, that test t6137\n> failed on cygwin:\n>\n>   $ tail test-out-2-50-rc0 \n>   Test Summary Report\n>   -------------------\n>   t6137-pathspec-wildcards-literal.sh              (Wstat: 256 (exited 1) Tests: 25 Failed: 11)\n>     Failed tests:  2, 7, 9, 11, 14-15, 17, 19, 21, 23, 25\n>     Non-zero exit status: 1\n>   Files=1023, Tests=30946, 21783 wallclock secs (19.08 usr 42.17 sys + 4031.65 cusr 12965.78 csys = 17058.68 CPU)\n>   Result: FAIL\n>   make[1]: *** [Makefile:78: prove] Error 1\n>   make[1]: Leaving directory '/home/ramsay/git/t'\n>   make: *** [Makefile:3286: test] Error 2\n>   $ \n>\n> A quick squint at the failing tests made it clear that the failure was\n> caused by the cygwin build treating a quoted glob character sequence\n> (e.g. '\\*') as a directory separator char followed by a glob character.\n\nShould we revert ec727e18 (dir.c: literal match with wildcard in\npathspec should still glob, 2025-05-03) before deciding to how to\nproceed, as we will be deep in prerelease freeze?\n\nIt's not a \"fix\" for something that is gravely wrong but a glitch\npeople have lived with almost forever, so it can be reattempted in\nthe next cycle without hurting much.\n\nThanks.\n\n\n"},{"id":"519588","messageId":"780f09cb-5399-4256-91ca-d93a553540c0@ramsayjones.plus.com","threadId":"63567","inReplyTo":"xmqq5xhcpzyp.fsf@gitster.g","subject":"Re: v2.25.0-rc0 test failure on cygwin","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2025-06-03T19:03:39Z","receivedAt":"2025-06-03T19:06:51Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 03/06/2025 17:11, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:\n> \n[snip]\n>> A quick squint at the failing tests made it clear that the failure was\n>> caused by the cygwin build treating a quoted glob character sequence\n>> (e.g. '\\*') as a directory separator char followed by a glob character.\n> \n> Should we revert ec727e18 (dir.c: literal match with wildcard in\n> pathspec should still glob, 2025-05-03) before deciding to how to\n> proceed, as we will be deep in prerelease freeze?\n\nHeh, that decision is above my pay grade! :)\n\nBTW, I realized earlier today why we had not seen any CI failures\non windows (yes I'm a bit slow on the uptake!); the test has this\nconditional at the top:\n\n  test_have_prereq FUNNYNAMES || {\n         skip_all='skipping: needs FUNNYNAMES (non-Windows only)'\n         test_done\n  }\n\nAnd FUNNYNAMES (as indicated) is set on MINGW/Gfw, but not cygwin.\n(cygwin can cope with many 'funny' filenames, but it can't change\nthe use of '\\' as a win32 directory separator).\n\n> It's not a \"fix\" for something that is gravely wrong but a glitch\n> people have lived with almost forever, so it can be reattempted in\n> the next cycle without hurting much.\n\nThe POSIX/win32 pathname syntax 'issue' is not going away anytime\nsoon, so I suspect that just skipping these tests (or the entire\ntest file ala Gfw) is probably the best it gets. ;)\n\n[see Patrick's commit 5f8af25ff9 (t5500, t5601: skip tests which\nexercise paths with '[::1]' on Cygwin, 2024-10-16), which had been\nfailing from v2.25.0-rc0 (25 Dec 2019) to v2.48.0-rc0 (16 Dec 2024),\nwhich was actually caused by a commit which started allowing a win32\ndrive 'letter' to be an multi-byte UTF8 Unicode char! :) ]\n\nThanks.\n\nATB,\nRamsay Jones\n\n\n"}]}