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

Re: [RFC] worktree: add lifecycle hooks

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Sep 20, 2026, 18:25 UTC
Message-ID
<dd6815f4-30ac-4cc6-882e-e8c4eb0936cf@app.fastmail.com>
In-Reply-To
<20260920173333.1606-1-maciej.ciemborowicz@gmail.com>
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/
Previous: Maciej Ciemborowicz
Message 2 of 2 in “[RFC] worktree: add lifecycle hooks”
  1. Maciej CiemborowiczSep 20, 2026
  2. Kristoffer HaugsbakkSep 20, 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.