git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] allow TTY tests to run under recent Mac OS

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 14, 2014, 20:16 UTC
Message-ID
<xmqqfvdl35d0.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141114200239.GA11581@peff.net>
Jeff King <peff@peff.net> writes:
Show 31 quoted lines
> 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.

Previous: Michael Blume
Message 7 of 7 in “allow TTY tests to run under recent Mac OS”
  1. allow TTY tests to run under recent Mac OSMike Blume, Nov 13, 2014
  2. John SzakmeisterNov 14, 2014
  3. Johannes SixtNov 14, 2014
  4. Michael BlumeNov 14, 2014
  5. Jeff KingNov 14, 2014
  6. Michael BlumeNov 14, 2014
  7. Junio C HamanoNov 14, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.