Git development
 help / color / mirror / Atom feed
From: Caleb White <cdwhite3@pm.me>
To: domen@cachix.org, git@vger.kernel.org
Cc: "Phillip Wood" <phillip.wood123@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Caleb White" <cdwhite3@pm.me>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH v2 1/4] worktree: add post-worktree-add hook
Date: Tue, 04 Aug 2026 20:03:57 +0000	[thread overview]
Message-ID: <DKGFFRLXG2GY.VYU49MX8QE8Q@pm.me> (raw)
In-Reply-To: <9f6bb2ec-afe3-4a1c-ade2-addf73f8681d@mtasv.net>

On Tue Aug 4, 2026 at 1:14 PM CDT, Domen Kožar wrote:
> Introduce a post-worktree-add hook that runs after the working tree
> has been fully set up, including with --no-checkout and --orphan. The
> hook runs inside the new working tree with GIT_DIR and GIT_WORK_TREE
> cleared, mirroring the existing post-checkout invocation, and takes no
> arguments. Details such as the absolute path, worktree identifier, and
> checked-out branch can be queried by running git from the hook's working
> directory. Taking no arguments also lets a configured command shared
> with post-worktree-remove distinguish the events by argument count.

It looks like the `post-worktree-remove` and `post-worktree-move` hooks
both receive arguments but this hook does not. While the hook can
certainly use git to query the path and identifier, if you already have
that information I'm not sure why you can't and shouldn't just pass it
through to the hook (same thing goes for the new path and identifier on
the move hook).


Best,
Caleb


  reply	other threads:[~2026-08-04 20:04 UTC|newest]

Thread overview: 11+ 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
     [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 [this message]
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

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=DKGFFRLXG2GY.VYU49MX8QE8Q@pm.me \
    --to=cdwhite3@pm.me \
    --cc=avarab@gmail.com \
    --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