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

Re: [PATCH v5 0/2] includeIf: add "worktree" condition for matching working tree path

From
Chen Linxuan <me@black-desk.cn>
Date
May 25, 2026, 09:00 UTC
Message-ID
<CAC1kPDPbyxs-aTrAOi_PNTZF7EApG31iLYwm+Eddpeh2hT8a-w@mail.gmail.com>
In-Reply-To
<xmqqjysseyid.fsf@gitster.g>
On Mon, May 25, 2026 at 3:31 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
>
> Chen Linxuan via B4 Relay <devnull+me.black-desk.cn@kernel.org>
> writes:
>
> > Changes in v5:
> > - Fix Windows CI failure: use `**` glob pattern instead of `/` in the
> >   "worktree without repository" tests, since `/` as a path pattern is
> >   Unix-specific and does not match Windows paths.
>
> Would it have worked if you used something like "[/\\].path",
> instead of "/.path", to cover directory delimiters for both systems?
>
> I am not asking to make further changes.  I am trying to understand
> what the extent of the problem was.

The root cause is that on Windows, strbuf_realpath() returns paths with a drive letter prefix (e.g. D:/a/git/...), which does not start with /.

Here is the trace output from the Windows CI [1]:

include_by_path: text='D:/a/git/git/t/trash directory.t1305-config-include', pattern='/**', prefix=0

The pattern worktree:/ becomes /** after add_trailing_starstar_for_dir(). Then wildmatch("/**", "D:/a/git/...", WM_PATHNAME) fails because the text does not start with /.

[1] https://github.com/black-desk/git/actions/runs/26391768962/job/77683708185
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “config: refactor include_by_gitdir() into include_by_path()”
  1. 1/2 config: refactor include_by_gitdir() into include_by_path()Chen Linxuan via B4 Relay, May 25, 2026
  2. 0/2 includeIf: add "worktree" condition for matching working tree pathChen Linxuan via B4 Relay, May 25, 2026
  3. 2/2 config: add "worktree" and "worktree/i" includeIf conditionsChen Linxuan via B4 Relay, May 25, 2026
  4. Junio C HamanoMay 25, 2026
  5. Chen LinxuanMay 25, 2026
  6. Junio C HamanoMay 25, 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.