git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t3070: skip ls-files tests with backslash patterns on Windows

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2026, 20:25 UTC
Message-ID
<xmqqecivjn7k.fsf@gitster.g>
In-Reply-To
<pull.2128.git.1779958849319.gitgitgadget@gmail.com>

"Kristofer Karlsson via GitGitGadget" <gitgitgadget@gmail.com> writes:

Show 18 quoted lines
> 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.
Previous: Kristofer Karlsson via GitGitGadgetNext: Kristofer Karlsson
Message 2 of 4 in “t3070: skip ls-files tests with backslash patterns on Windows”
  1. t3070: skip ls-files tests with backslash patterns on WindowsKristofer Karlsson via GitGitGadget, May 28, 2026
  2. Junio C HamanoMay 28, 2026
  3. Kristofer KarlssonMay 29, 2026
  4. Junio C HamanoJun 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.