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

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

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Apr 1, 2026, 08:27 UTC
Message-ID
<54592b30-0b48-4ec1-a413-903db846870e@app.fastmail.com>
In-Reply-To
<20260401-includeif-worktree-v1-0-906db69f2c79@black-desk.cn>
On Wed, Apr 1, 2026, at 09:33, Chen Linxuan via B4 Relay wrote:
Show 18 quoted lines
> The `includeIf` mechanism already supports matching on the `.git`
> directory path (`gitdir`) and the currently checked out branch
> (`onbranch`).  But in multi-worktree setups the `.git` directory of a
> linked worktree points into the main repository's `.git/worktrees/`
> area, which makes `gitdir` patterns cumbersome when one wants to
> include config based on the working tree's checkout path instead.
>
> Introduce two new condition keywords:
>
>   - `worktree:<pattern>` matches the realpath of the current worktree's
>     working directory against a glob pattern.
>   - `worktree/i:<pattern>` is the case-insensitive variant.
>
> Supported pattern features: glob wildcards, `**/` and `/**`, `~`
> expansion, `./` relative paths, and trailing-`/` prefix matching.
> The condition never matches in a bare repository.
>
> Signed-off-by: Chen Linxuan <me@black-desk.cn>

The cover letter here is signed off (not necessary) but none of the patches are.

> ---
>[snip]
Previous: Chen Linxuan via B4 Relay
Message 5 of 5 in “includeIf: add "worktree" condition for matching working tree path”
  1. 0/3 includeIf: add "worktree" condition for matching working tree pathChen Linxuan via B4 Relay, Apr 1, 2026
  2. 1/3 config: add "worktree" and "worktree/i" includeIf conditionsChen Linxuan via B4 Relay, Apr 1, 2026
  3. 3/3 t1305: add tests for includeIf "worktree"Chen Linxuan via B4 Relay, Apr 1, 2026
  4. 2/3 Documentation/config: add includeIf "worktree"Chen Linxuan via B4 Relay, Apr 1, 2026
  5. Kristoffer HaugsbakkApr 1, 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.