t3070: skip ls-files tests with backslash patterns on Windows#2128
Open
spkrka wants to merge 1 commit into
Open
t3070: skip ls-files tests with backslash patterns on Windows#2128spkrka wants to merge 1 commit into
spkrka wants to merge 1 commit into
Conversation
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>
Member
|
/allow |
Author
|
/submit |
|
User spkrka already allowed to use GitGitGadget. |
|
Submitted as pull.2128.git.1779958849319.gitgitgadget@gmail.com To fetch this version into To fetch this version to local tag |
|
Junio C Hamano wrote on the Git mailing list (how to reply to this email): "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. |
|
This patch series was integrated into seen via git@07b73d6. |
|
Kristofer Karlsson wrote on the Git mailing list (how to reply to this email): On Thu, 28 May 2026 at 22:26, Junio C Hamano <gitster@pobox.com> wrote:
> 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)?
>
I am fairly new to the git ecosystem as a developer (not as a user),
so I am not sure how long this has been broken. The backslash patterns
in the ls-files test path predate 8a6d158a - patterns like 'foo\*'
and '[\-_]' have been there since de8bada2bf (2018) - so it may
have been failing for a while before anyone noticed.
My thinking was that it would be good in general if the CI results
were green and did not include false positives for errors that we
know cannot work on this platform. The risk is that people stop
looking into CI failures in detail because they start to assume it
is the same old backslash problem.
That said, there is also a risk that the real underlying issue does
not get fixed. I am hoping it is sufficient that the BSLASHPSPEC
prereq and the case *\\* filter make it obvious to anyone reading
the test what we are skipping over and why.
> Will queue. Thanks.
Thanks! It felt a bit heavyweight to add noise to the list for trivial CI test
changes but I suppose the process is the same even if it does not
affect the production code. |
|
User |
|
This branch is now known as |
|
This patch series was integrated into seen via git@2945625. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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."
cc: @dscho
cc: Kristofer Karlsson krka@spotify.com