public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Michael Blume <blume.mike@gmail•com>,
	Johannes Sixt <j6t@kdbg•org>, Git List <git@vger•kernel.org>
Subject: Re: [PATCH v2] allow TTY tests to run under recent Mac OS
Date: Fri, 14 Nov 2014 12:16:27 -0800	[thread overview]
Message-ID: <xmqqfvdl35d0.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141114200239.GA11581@peff.net> (Jeff King's message of "Fri, 14 Nov 2014 15:02:39 -0500")

Jeff King <peff@peff•net> writes:

> On Fri, Nov 14, 2014 at 11:48:36AM -0800, Michael Blume wrote:
>
>> My understanding is that && and || have equal precedence, and this
>> seems to be borne out in testing at my shell. If the if/then method is
>> clearer I'm happy to go with that.
>
> I think the problem is that there are earlier parts of the chain. It
> currently looks like:
>
>   foo &&
>   bar &&
>   do_something
>
> but you are making it:
>
>   foo &&
>   bar || baz &&
>   do_something
>
> which will do_something whether or not "foo" is true. You need to put
> your "||" at a lower precedence than the rest of the chain. The "if"
> that Johannes mentioned works, though I think
>
>   test_have_prereq PERL &&
>   {
>     test "$(uname -s)" != Darwin ||
>     test "$(uname -r | cut -d. -f1)" -ge 13
>   } &&
>   ...
>
> is more obvious to read (but that's subjective, of course).

Thanks.

While I was reading this earlier I wondered the same thing and
concluded it was OK based on the equal precedence, but like Michael
I missed that there is yet another test before it.

      parent reply	other threads:[~2014-11-14 20:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 22:40 [PATCH v2] allow TTY tests to run under recent Mac OS Mike Blume
2014-11-14 10:43 ` John Szakmeister
2014-11-14 19:23 ` Johannes Sixt
2014-11-14 19:48   ` Michael Blume
2014-11-14 20:02     ` Jeff King
2014-11-14 20:04       ` Michael Blume
2014-11-14 20:16       ` Junio C Hamano [this message]

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=xmqqfvdl35d0.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=blume.mike@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=j6t@kdbg$(echo .)org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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