git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Turner <dturner@twopensource.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Eric Sunshine" <sunshine@sunshineco.com>,
	"Git List" <git@vger.kernel.org>,
	"Christian Couder" <chriscool@tuxfamily.org>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Jacob Keller" <jacob.keller@gmail.com>
Subject: Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree
Date: Thu, 13 Aug 2015 16:32:26 -0400	[thread overview]
Message-ID: <1439497946.8855.22.camel@twopensource.com> (raw)
In-Reply-To: <55CCFB32.30608@alum.mit.edu>

On Thu, 2015-08-13 at 22:16 +0200, Michael Haggerty wrote:
> On 08/13/2015 07:41 PM, David Turner wrote:
> > On Thu, 2015-08-13 at 13:15 -0400, Eric Sunshine wrote:
> >> On Wed, Aug 12, 2015 at 5:57 PM, David Turner <dturner@twopensource.com> wrote:
> >>> diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
> >>> index 93605f4..28e6dff 100755
> >>> --- a/t/t0060-path-utils.sh
> >>> +++ b/t/t0060-path-utils.sh
> >>> +test_expect_success 'handle per-worktree refs in refs/worktree' '
> >>> +       git commit --allow-empty -m "initial commit" &&
> >>> +       git worktree add -b branch worktree &&
> >>> +       (
> >>> +               cd worktree &&
> >>> +               git commit --allow-empty -m "test commit"  &&
> >>> +               git for-each-ref | test_must_fail grep refs/worktree &&
> >>
> >> s/test_must_fail/!/
> >>
> >> From t/README:
> >>
> >>    On the other hand, don't use test_must_fail for running regular
> >>    platform commands; just use '! cmd'.  We are not in the business
> >>    of verifying that the world given to us sanely works.
> > 
> > When I make that change, my test fails with:
> > 
> > FATAL: Unexpected exit with code 2
> > 
> > Apparently, you can't use ! in pipelines like that.  So that's why I
> > used test_must_fail.
> 
> You would have to negate the whole pipeline, like
> 
>     ! git for-each-ref | grep refs/worktree
> 
> The result of a pipeline is taken from the last command.

Yes, but that would pass if for-each-ref fails, which I do not want.  

Jacob's suggestion of parentheses around (! grep refs/worktree) seems to
work.

  reply	other threads:[~2015-08-13 20:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12 21:57 [PATCH v3 1/4] refs: clean up common_list David Turner
2015-08-12 21:57 ` [PATCH v3 2/4] path: optimize common dir checking David Turner
2015-08-12 22:48   ` Junio C Hamano
2015-08-13  9:05   ` Michael Haggerty
2015-08-14 17:04     ` Junio C Hamano
2015-08-14 20:04       ` David Turner
2015-08-14 20:27         ` Junio C Hamano
2015-08-14 20:54           ` David Turner
2015-08-15 18:20         ` Michael Haggerty
2015-08-15 18:12       ` Michael Haggerty
2015-08-17 15:55         ` Junio C Hamano
2015-08-15  7:59   ` Duy Nguyen
2015-08-16  5:04     ` David Turner
2015-08-16 12:20       ` Duy Nguyen
2015-08-12 21:57 ` [PATCH v3 3/4] refs: make refs/worktree/* per-worktree David Turner
2015-08-13 17:15   ` Eric Sunshine
2015-08-13 17:41     ` David Turner
2015-08-13 20:16       ` Michael Haggerty
2015-08-13 20:32         ` David Turner [this message]
2015-08-14  8:18           ` Michael Haggerty
2015-08-14 17:10             ` Junio C Hamano
2015-08-15  8:04   ` Duy Nguyen
2015-08-12 21:57 ` [PATCH v3 4/4] bisect: make bisection refs per-worktree David Turner
2015-08-15  7:44 ` [PATCH v3 1/4] refs: clean up common_list Duy Nguyen

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=1439497946.8855.22.camel@twopensource.com \
    --to=dturner@twopensource.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=mhagger@alum.mit.edu \
    --cc=pclouds@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).