git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:02 UTC

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

From
Chen Linxuan <me@black-desk.cn>
Date
May 13, 2026, 02:55 UTC
Message-ID
<CAC1kPDNAFRp+t+_KRUfV_nUXj6nFBNEHp05odiVXsUOw3+tcrA@mail.gmail.com>
In-Reply-To
<xmqqo6iklid5.fsf@gitster.g>
On Wed, May 13, 2026 at 12:09 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
>
> Phillip Wood <phillip.wood123@gmail.com> 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?

Yes, that is exactly why I added this feature. I contribute to the Linux kernel both as an employee and as an individual. I want to automatically use my company email address whenever I create a worktree under a specific directory.

Previous: Chen LinxuanNext: Patrick Steinhardt
Message 10 of 11 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, Apr 3, 2026
  2. 0/2 includeIf: add "worktree" condition for matching working tree pathChen Linxuan via B4 Relay, Apr 3, 2026
  3. 2/2 config: add "worktree" and "worktree/i" includeIf conditionsChen Linxuan via B4 Relay, Apr 3, 2026
  4. Junio C HamanoMay 12, 2026
  5. Patrick SteinhardtMay 12, 2026
  6. Patrick SteinhardtMay 12, 2026
  7. Phillip WoodMay 12, 2026
  8. Junio C HamanoMay 12, 2026
  9. Chen LinxuanMay 13, 2026
  10. Chen LinxuanMay 13, 2026
  11. Patrick SteinhardtMay 13, 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.