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:47 UTC
- Message-ID
- <DIH7FB91JHU1.3OOTDQ6QEZZJZ@black-desk.cn>
- In-Reply-To
- <agLTO0amktCWMsiE@pks.im>
On Tue, 12 May 2026 09:14:03 +0200, Patrick Steinhardt wrote:
Show 16 quoted lines
> On Fri, Apr 03, 2026 at 03:02:29PM +0800, Chen Linxuan via B4 Relay wrote: > > ... > > The implementation reuses the include_by_path() helper introduced in > > the previous commit, passing the worktree path in place of the > > gitdir. The condition never matches in bare repositories (where > > there is no worktree) or during early config reading (where no > > repository is available). > > Right. This is because `repo_get_work_tree()` would return a NULL > pointer in these cases, and `include_by_path()` exits early in that > case. > > ... > > This whole listing here is the exact same as we have for the `gitdir` > condition. Can we maybe deduplicate these into a common section?
Sure, will be updated in V4.
Show 6 quoted lines
> ... > > Just because it was explicitly mentioned: we might also want to have a > test that verifies this works with early-config parsing. We already have > a similar test for "gitdir:" in "conditional include, early config > reading".
As I wrote in the commit message, this is not going to work with early-config parsing. I am working on the fix. But I am not quite sure that this is a must-fix issue or not.
> And should we also have a "nongit" branch where we verify outside a > repository?
Sure, will be added in V4.
Chen Linxuan