Re: [RFC] worktree: add lifecycle hooks
On Sun, Sep 20, 2026, at 19:33, Maciej Ciemborowicz wrote:
Show 16 quoted lines
> Hello,
>
> I'd like to discuss adding native hooks for worktree lifecycle events.
>
> Git currently invokes `post-checkout` after `git worktree add` when a
> checkout is performed. This makes it possible to detect some worktree
> creation cases indirectly. There does not appear to be a native hook for
> other worktree lifecycle operations such as:
>
> git worktree add
> git worktree remove
> git worktree move
> git worktree lock
> git worktree unlock
> git worktree prune
>[snip]
See https://lore.kernel.org/git/7c8b4673-37ac-45fa-ad8c-a1dc09afe5fe@mtasv.net/