Git development
 help / color / mirror / Atom feed
From: Maciej Ciemborowicz <maciej.ciemborowicz@gmail.com>
To: gitster@pobox.com
Cc: cdwhite3@pm.me, domen@cachix.org, git@vger.kernel.org,
	phillip.wood123@gmail.com, sunshine@sunshineco.com, ps@pks.im,
	avarab@gmail.com
Subject: Re: [PATCH v2 0/4] worktree: add lifecycle hooks
Date: Sat,  3 Oct 2026 20:47:25 +0200	[thread overview]
Message-ID: <20261003184725.29917-1-maciej.ciemborowicz@gmail.com> (raw)
In-Reply-To: <xmqqtsp9tyu0.fsf@gitster.g>

Hi Junio,

Thank you for the detailed explanation. I agree that a wrapper is the
right answer when the user controls the invocation of `git worktree`.

I tried that approach for a tool I am building: it creates an isolated
container environment for each worktree. This matters in particular for
projects with databases and migrations, where two agents working in
parallel must not share an environment.

The problem is that, in this case, the worktree is often created by the
IDE rather than by the user or the agent. For example, Codex in VS Code
creates worktrees itself when it starts parallel agent sessions. A
`git-wt` wrapper is therefore bypassed, and asking agents to use one does
not help: by the time an agent begins work, the worktree may already
exist and its environment needs to have been provisioned.

It is possible to approximate this with polling or instructions in an
AGENTS.md file, but neither provides a reliable lifecycle boundary.
There is a race between worktree creation and the agent beginning work,
and cleanup on removal has the same issue.

So I wanted to report a concrete case where wrappers do not reach the
actor that performs the operation. This has also been the most consistent
feedback I have heard from people using parallel AI agents: they do not
want to replace every worktree caller with a wrapper; they need a
repository-local way to react when Git creates, moves, or removes a
worktree.

Best regards,
Maciej Ciemborowicz

  parent reply	other threads:[~2026-10-03 18:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09 23:36 [PATCH v1 0/3] worktree: add post-worktree-add and post-worktree-remove hooks Domen Kožar
2026-07-10  9:34 ` Phillip Wood
     [not found]   ` <CAMvcdZS=ZYbLmjKaGJvjQ_fWYhVbOzwMvYq+MMENWPYi_RiqvQ@mail.gmail.com>
2026-07-13 13:19     ` Phillip Wood
2026-08-04 18:14 ` [PATCH v2 0/4] worktree: add lifecycle hooks Domen Kožar
2026-08-04 19:03   ` Caleb White
2026-08-04 20:28     ` Junio C Hamano
2026-08-30 17:21       ` Domen Kožar
2026-09-07 14:30         ` Domen Kožar
2026-09-07 18:18           ` Kristoffer Haugsbakk
2026-09-07 19:34             ` Domen Kožar
2026-10-03 18:47       ` Maciej Ciemborowicz [this message]
2026-10-04 23:09   ` [PATCH v3 0/2] worktree: add post-worktree lifecycle hook Domen Kožar
2026-10-05 16:47     ` Junio C Hamano
     [not found]   ` <cover.1791152172.git.domen@cachix.org>
2026-10-04 23:09     ` [PATCH v3 1/2] " Domen Kožar
2026-10-06  9:23       ` Phillip Wood
2026-10-04 23:09     ` [PATCH v3 2/2] worktree: notify post-worktree hook when pruning Domen Kožar
     [not found] ` <20260804181358.532970-1-domen@cachix.org>
2026-08-04 18:14   ` [PATCH v2 1/4] worktree: add post-worktree-add hook Domen Kožar
2026-08-04 20:03     ` Caleb White
2026-08-04 18:14   ` [PATCH v2 2/4] worktree: add post-worktree-remove hook Domen Kožar
2026-08-04 18:14   ` [PATCH v2 3/4] worktree: run post-worktree-remove hook when pruning Domen Kožar
2026-08-04 18:14   ` [PATCH v2 4/4] worktree: add post-worktree-move hook Domen Kožar
  -- strict thread matches above, loose matches on Subject: below --
2026-08-11 20:26 [PATCH v2 0/4] worktree: add lifecycle hooks <Alexander G. Riccio>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261003184725.29917-1-maciej.ciemborowicz@gmail.com \
    --to=maciej.ciemborowicz@gmail.com \
    --cc=avarab@gmail.com \
    --cc=cdwhite3@pm.me \
    --cc=domen@cachix.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood123@gmail.com \
    --cc=ps@pks.im \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox