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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2026, 16:09 UTC
Message-ID
<xmqqo6iklid5.fsf@gitster.g>
In-Reply-To
<d236de15-f03e-4bac-9eb1-c14e50a271f5@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 19 quoted lines
> 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.
Previous: Phillip WoodNext: Chen Linxuan
Message 7 of 11 in “includeIf: add "worktree" condition for matching working tree path”
  1. 0/2 includeIf: add "worktree" condition for matching working tree pathChen Linxuan via B4 Relay, Apr 3, 2026
  2. 1/2 config: refactor include_by_gitdir() into include_by_path()Chen Linxuan via B4 Relay, Apr 3, 2026
  3. Patrick SteinhardtMay 12, 2026
  4. 2/2 config: add "worktree" and "worktree/i" includeIf conditionsChen Linxuan via B4 Relay, Apr 3, 2026
  5. Patrick SteinhardtMay 12, 2026
  6. Phillip WoodMay 12, 2026
  7. Junio C HamanoMay 12, 2026
  8. Chen LinxuanMay 13, 2026
  9. Chen LinxuanMay 13, 2026
  10. Patrick SteinhardtMay 13, 2026
  11. Junio C HamanoMay 12, 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.