From: Junio C Hamano <gitster@pobox.com>
To: "Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Kristofer Karlsson <krka@spotify.com>
Subject: Re: [PATCH] t3070: skip ls-files tests with backslash patterns on Windows
Date: Fri, 29 May 2026 05:25:35 +0900 [thread overview]
Message-ID: <xmqqecivjn7k.fsf@gitster.g> (raw)
In-Reply-To: <pull.2128.git.1779958849319.gitgitgadget@gmail.com> (Kristofer Karlsson via GitGitGadget's message of "Thu, 28 May 2026 09:00:48 +0000")
"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com>
writes:
> From: Kristofer Karlsson <krka@spotify.com>
>
> On Windows (MINGW), backslashes in pathspecs are silently converted to
> forward slashes (directory separators), which changes the glob semantics.
> This causes 36 test failures in t3070-wildmatch when the "via ls-files"
> variants test patterns containing backslash escapes (e.g. '\[ab]',
> '[\-_]', '[A-\\]').
>
> The wildmatch function itself handles these patterns correctly — only the
> ls-files code path fails because pathspec parsing converts the
> backslashes before they reach the glob matcher.
>
> Skip these ls-files tests on platforms where BSLASHPSPEC is not set,
> which is the existing prereq that captures exactly this semantic:
> "backslashes in pathspec are not directory separators."
>
> Signed-off-by: Kristofer Karlsson <krka@spotify.com>
> ---
Thanks for noticing and addressing this. I think we fairly recently
started seeing this in GitHub actions CI, which puzzles me since
neither t3070 or wildmatch.[ch] have changed for quite some time.
8a6d158a (doc: document backslash in gitignore patterns, 2025-10-29)
added a few lines to the test about matching with backslash to t3070.
Two questions.
* Has this been broken on Windows since October, or has something
external change on Windows recently? I do not know. Anybody
knows?
* Is this change a workaround that sweeps ugly breakage under the
rug, or is backslash inherently unusable as an excape character
when handling paths on Windows (which I am afraid would make
wildmatch fairly useless there)?
Will queue. Thanks.
next prev parent reply other threads:[~2026-05-28 20:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 9:00 [PATCH] t3070: skip ls-files tests with backslash patterns on Windows Kristofer Karlsson via GitGitGadget
2026-05-28 20:25 ` Junio C Hamano [this message]
2026-05-29 8:04 ` Kristofer Karlsson
2026-06-03 14:23 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqecivjn7k.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=krka@spotify.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox