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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2026, 19:23 UTC
Message-ID
<xmqqfr1u38oq.fsf@gitster.g>
In-Reply-To
<ak0am-pEdtOvyBp4@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 18 quoted lines
>> > The last call to git-config(1) fails, which is inconsistent with how
>> > resolve the path for "gitdir".
>> 
>> I investigated the symlink mismatch.
>> ...
>> My current possible v7 approach is to keep `repo->worktree` canonical,
>> but store an additional absolute, normalized, non-realpath worktree path
>> for `includeIf.worktree`. For the ordinary discovered-repository case,
>> this has to be derived in `setup_discovered_git_dir()` from physical
>> `cwd`, the worktree-root offset, and a validated `$PWD`, because
>> `set_git_work_tree()` is otherwise only called with `"."`.
>> 
>> This makes your suggested test pass, but the plumbing is less trivial
>> than the original patch. Does this approach sound reasonable, or would
>> you prefer different semantics for symlinked worktree paths?
>
> It certainly sounds a bit ugly, but I'd rather have something that's
> ugly than something that's inconsistent for our users *shrug*

OK, so I'd expect v7 to come and then we hopefully can declare victory ;-). Thanks, both.

Previous: Patrick Steinhardt
Message 8 of 8 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, Jul 3, 2026
  2. 1/2 config: refactor include_by_gitdir() into include_by_path()Chen Linxuan via B4 Relay, Jul 3, 2026
  3. 2/2 config: add "worktree" and "worktree/i" includeIf conditionsChen Linxuan via B4 Relay, Jul 3, 2026
  4. Junio C HamanoJul 3, 2026
  5. Patrick SteinhardtJul 3, 2026
  6. Chen LinxuanJul 6, 2026
  7. Patrick SteinhardtJul 7, 2026
  8. Junio C HamanoJul 7, 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.