From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Lars Schneider <larsxschneider@gmail.com>,
matthew.k.gumbel@intel.com
Subject: Re: [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location
Date: Thu, 15 Feb 2018 16:27:51 -0500 [thread overview]
Message-ID: <20180215212751.GA42108@flurp.local> (raw)
In-Reply-To: <xmqqh8qi7z7o.fsf@gitster-ct.c.googlers.com>
On Thu, Feb 15, 2018 at 12:52:11PM -0800, Junio C Hamano wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > test_expect_success '"add" invokes post-checkout hook (branch)' '
> > post_checkout_hook &&
> > - printf "%s %s 1\n" $_z40 $(git rev-parse HEAD) >hook.expect &&
> > + {
> > + echo $_z40 $(git rev-parse HEAD) 1 &&
> > + echo $(pwd)/.git/worktrees/gumby &&
> > + echo $(pwd)/gumby
> > + } >hook.expect &&
> > git worktree add gumby &&
> > - test_cmp hook.expect hook.actual
> > + test_cmp hook.expect gumby/hook.actual
> > '
>
> This seems to segfault on me, without leaving hook.actual anywhere.
I'm unable to reproduce the segfault, but I'm guessing it's because
I'm a dummy. Can you squash in the following and retry?
--- >8 ---
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 604a0292b0..f69f862947 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -348,7 +348,7 @@ static int add_worktree(const char *path, const char *refname,
if (!ret && opts->checkout) {
const char *hook = find_hook("post-checkout");
if (hook) {
- const char *env[] = { "GIT_DIR", "GIT_WORK_TREE" };
+ const char *env[] = { "GIT_DIR", "GIT_WORK_TREE", NULL };
cp.git_cmd = 0;
cp.no_stdin = 1;
cp.stdout_to_stderr = 1;
--- >8 ---
If that fixes it, can you squash it locally or should I re-send?
next prev parent reply other threads:[~2018-02-15 21:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-10 1:01 [PATCH v1] worktree: set worktree environment in post-checkout hook lars.schneider
2018-02-10 1:28 ` Lars Schneider
2018-02-12 3:15 ` [PATCH 0/2] worktree: change to new worktree dir before running hook(s) Eric Sunshine
2018-02-12 3:15 ` [PATCH 1/2] run-command: teach 'run_hook' about alternate worktrees Eric Sunshine
2018-02-12 20:58 ` Lars Schneider
2018-02-12 21:49 ` Eric Sunshine
2018-02-12 3:15 ` [PATCH 2/2] worktree: add: change to new worktree directory before running hook Eric Sunshine
2018-02-12 19:37 ` Junio C Hamano
2018-02-12 20:31 ` Eric Sunshine
2018-02-12 20:01 ` Lars Schneider
2018-02-13 4:42 ` Eric Sunshine
2018-02-13 4:48 ` Eric Sunshine
2018-02-13 7:27 ` Johannes Sixt
2018-02-13 7:34 ` Eric Sunshine
2018-02-15 19:18 ` [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location Eric Sunshine
2018-02-15 20:52 ` Junio C Hamano
2018-02-15 21:27 ` Eric Sunshine [this message]
2018-02-15 21:36 ` Junio C Hamano
2018-02-15 23:09 ` Eric Sunshine
2018-02-15 23:09 ` [PATCH v3] " Eric Sunshine
2018-02-16 16:55 ` Lars Schneider
2018-02-16 18:27 ` Eric Sunshine
2018-02-16 18:05 ` Junio C Hamano
2018-02-12 3:27 ` [PATCH v1] worktree: set worktree environment in post-checkout hook Eric Sunshine
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=20180215212751.GA42108@flurp.local \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=larsxschneider@gmail.com \
--cc=matthew.k.gumbel@intel.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;
as well as URLs for NNTP newsgroup(s).