Subject: Re: [PATCH v3 2/2] config: add "worktree" and "worktree/i" includeIf conditions

From: Junio C Hamano <[email-masked]>
Date: Wed, 13 May 2026 01:09:42 +0900

Phillip Wood <[email-masked]> writes:

> On 12/05/2026 08:14, Patrick Steinhardt wrote:
> ...
>>> Introduce two new condition keywords:
>>>
>>>    - worktree:<pattern> matches the realpath of the current worktree's
>>>      working directory (i.e. repo_get_work_tree()) against a glob
>>>      pattern.  This is the path returned by git rev-parse
>>>      --show-toplevel.
>>>
>>>    - worktree/i:<pattern> is the case-insensitive variant.
>> 
>> Seems sensible.
>
> We already support per-worktree config settings via 
> extensions.worktreeConfig, so it would be helpful to explain why it is 
> more convenient to set the config based on the worktree's path, rather 
> than just running "git config --worktree" inside the worktree. Do you 
> have multiple repositories with worktrees checked out under a common 
> prefix that you want to share the same config setting?

Excellent point.  The documentation for the new feature may have to
be strengthened to suggest which one of the two approaches is more
appropriate with what use cases.

Thanks.