From: Eric Sunshine Date: Thu, 07 Dec 2017 10:19:51 GMT Subject: Re: 'git worktree add' does not fire post-checkout hook Message-ID: In-Reply-To: On Wed, Dec 6, 2017 at 4:45 PM, Eric Sunshine wrote: > On Wed, Dec 6, 2017 at 4:00 PM, Gumbel, Matthew K > wrote: >> I've noticed that when I run 'git worktree add /path/to/new/tree', >> the post-checkout hook does not fire, even though the worktree >> manpage explicitly states that "worktree add" will, "Create >> and checkout into it." >> >> Is this the intended behavior? Seems like maybe a bug, but I'm not >> sure. > > If you'd like to get your feet wet at contributing to the Git project, > this might be a good first dip, as it looks like an easy fix (a one- > or two-liner). The only thing which needs a bit of care is to skip the > hook when --no-checkout is specified. Other than that, 'githooks' > documentation would need an update to mention that git-worktree also > runs the hook, and t2025-worktree-add.sh would want a couple new tests > (which would probably be the most complex part of the patch). I worked up a patch to fix this oversight which I'll try to send out later today.