All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] includeIf: add "worktree" condition for matching working tree path
@ 2026-04-02  2:58 ` Chen Linxuan via B4 Relay
  0 siblings, 0 replies; 9+ messages in thread
From: Chen Linxuan @ 2026-04-02  2:58 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, Chen Linxuan

The `includeIf` mechanism already supports matching on the `.git`
directory path (`gitdir`) and the currently checked out branch
(`onbranch`).  But in multi-worktree setups the `.git` directory of a
linked worktree points into the main repository's `.git/worktrees/`
area, which makes `gitdir` patterns cumbersome when one wants to
include config based on the working tree's checkout path instead.

Introduce two new condition keywords:

  - `worktree:<pattern>` matches the realpath of the current worktree's
    working directory against a glob pattern.
  - `worktree/i:<pattern>` is the case-insensitive variant.

Supported pattern features: glob wildcards, `**/` and `/**`, `~`
expansion, `./` relative paths, and trailing-`/` prefix matching.
The condition never matches in a bare repository.

Signed-off-by: Chen Linxuan <me@black-desk.cn>
---
Changes in v2:

- Add missing signed-off-by lines.
- Link to v1: https://lore.kernel.org/r/20260401-includeif-worktree-v1-0-906db69f2c79@black-desk.cn

---
Chen Linxuan (3):
      config: add "worktree" and "worktree/i" includeIf conditions
      Documentation/config: add includeIf "worktree"
      t1305: add tests for includeIf "worktree"

 Documentation/config.adoc | 50 +++++++++++++++++++++++++++++++++++
 config.c                  | 25 ++++++++++--------
 t/t1305-config-include.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 130 insertions(+), 11 deletions(-)
---
base-commit: 270e10ad6dda3379ea0da7efd11e4fbf2cd7a325
change-id: 20260401-includeif-worktree-fcb64950dfba

Best regards,
-- 
Chen Linxuan <me@black-desk.cn>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-04-02 21:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02  2:58 [PATCH v2 0/3] includeIf: add "worktree" condition for matching working tree path Chen Linxuan
2026-04-02  2:58 ` Chen Linxuan via B4 Relay
2026-04-02  2:58 ` [PATCH v2 1/3] config: add "worktree" and "worktree/i" includeIf conditions Chen Linxuan
2026-04-02  2:58   ` Chen Linxuan via B4 Relay
2026-04-02 21:22   ` Junio C Hamano
2026-04-02  2:58 ` [PATCH v2 2/3] Documentation/config: add includeIf "worktree" Chen Linxuan
2026-04-02  2:58   ` Chen Linxuan via B4 Relay
2026-04-02  2:58 ` [PATCH v2 3/3] t1305: add tests for " Chen Linxuan
2026-04-02  2:58   ` Chen Linxuan via B4 Relay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.