From: Kristoffer Haugsbakk Date: Wed, 01 Apr 2026 08:27:21 GMT Subject: Re: [PATCH 0/3] includeIf: add "worktree" condition for matching working tree path 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: > 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:` matches the realpath of the current worktree's > working directory against a glob pattern. > - `worktree/i:` 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 The cover letter here is signed off (not necessary) but none of the patches are. > --- >[snip]