{"thread":{"id":"37958","subject":"[PATCH v2] allow TTY tests to run under recent Mac OS","startedAt":"2014-11-13T22:40:19Z","lastAt":"2014-11-14T20:16:27Z","messageCount":7,"participants":["Mike Blume","John Szakmeister","Johannes Sixt","Michael Blume","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"251868","messageId":"1415918419-20807-1-git-send-email-blume.mike@gmail.com","threadId":"37958","inReplyTo":null,"subject":"[PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Mike Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-13T22:40:19Z","receivedAt":"2014-11-13T22:40:19Z","isPatch":true,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"listed bug doesn't reproduce on Mac OS Yosemite. For now, just enable\nTTY on Yosemite and higher\n\nSigned-off-by: Mike Blume <blume.mike@gmail.com>\nImproved-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-terminal.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/lib-terminal.sh b/t/lib-terminal.sh\nindex 5184549..6395a34 100644\n--- a/t/lib-terminal.sh\n+++ b/t/lib-terminal.sh\n@@ -29,7 +29,10 @@ test_lazy_prereq TTY '\n \t# After 2000 iterations or so it hangs.\n \t# https://rt.cpan.org/Ticket/Display.html?id=65692\n \t#\n-\ttest \"$(uname -s)\" != Darwin &&\n+\t# Under Mac OS X 10.10.1 and Perl 5.18.2, this problem\n+\t# appears to be gone.\n+\t#\n+\ttest \"$(uname -s)\" != Darwin || test \"$(uname -r | cut -d. -f1)\" -ge 14 &&\n \n \tperl \"$TEST_DIRECTORY\"/test-terminal.perl \\\n \t\tsh -c \"test -t 1 && test -t 2\"\n-- \n2.2.0.rc1.197.g60bf093\n"},{"id":"251880","messageId":"CAEBDL5VgxTMyxx6FTxocuJ3hJ+yK-VF+RycFi5Fitc+V==UEnw@mail.gmail.com","threadId":"37958","inReplyTo":"1415918419-20807-1-git-send-email-blume.mike@gmail.com","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2014-11-14T10:43:27Z","receivedAt":"2014-11-14T10:43:27Z","isPatch":true,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"On Thu, Nov 13, 2014 at 5:40 PM, Mike Blume <blume.mike@gmail.com> wrote:\n> listed bug doesn't reproduce on Mac OS Yosemite. For now, just enable\n> TTY on Yosemite and higher\n\nI've tried the reproduction recipe on Mavericks (`uname -r` => 13.4.0)\nand it works fine--still going after 12,000 iterations.  Trying the\nsame thing on Snow Leopard shows that it still fails there--it died\nafter 182 iterations.\n\nSo I think the check can be relaxed to `-ge 13`.\n\n-John\n"},{"id":"251896","messageId":"546656C8.3070009@kdbg.org","threadId":"37958","inReplyTo":"1415918419-20807-1-git-send-email-blume.mike@gmail.com","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2014-11-14T19:23:52Z","receivedAt":"2014-11-14T19:23:52Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 13.11.2014 um 23:40 schrieb Mike Blume:\n> listed bug doesn't reproduce on Mac OS Yosemite. For now, just enable\n> TTY on Yosemite and higher\n> \n> Signed-off-by: Mike Blume <blume.mike@gmail.com>\n> Improved-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/lib-terminal.sh | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/t/lib-terminal.sh b/t/lib-terminal.sh\n> index 5184549..6395a34 100644\n> --- a/t/lib-terminal.sh\n> +++ b/t/lib-terminal.sh\n> @@ -29,7 +29,10 @@ test_lazy_prereq TTY '\n>  \t# After 2000 iterations or so it hangs.\n>  \t# https://rt.cpan.org/Ticket/Display.html?id=65692\n>  \t#\n> -\ttest \"$(uname -s)\" != Darwin &&\n> +\t# Under Mac OS X 10.10.1 and Perl 5.18.2, this problem\n> +\t# appears to be gone.\n> +\t#\n> +\ttest \"$(uname -s)\" != Darwin || test \"$(uname -r | cut -d. -f1)\" -ge 14 &&\n\nThis is part of an &&-chain; you can't just throw in a || in the middle.\n\nHow about\n\n\tif test \"$(uname -s)\" = Darwin\n\tthen\n\t\ttest \"$(uname -r | cut -d. -f1)\" -ge 14\n\tfi &&\n\n>  \n>  \tperl \"$TEST_DIRECTORY\"/test-terminal.perl \\\n>  \t\tsh -c \"test -t 1 && test -t 2\"\n> \n\n-- Hannes\n"},{"id":"251901","messageId":"CAO2U3QgmuwatfDDO8f461cwq2SctPx+owL8gDMBpNyDcaxaWGQ@mail.gmail.com","threadId":"37958","inReplyTo":"546656C8.3070009@kdbg.org","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-14T19:48:36Z","receivedAt":"2014-11-14T19:48:36Z","isPatch":true,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"My understanding is that && and || have equal precedence, and this\nseems to be borne out in testing at my shell. If the if/then method is\nclearer I'm happy to go with that.\n\nOn Fri, Nov 14, 2014 at 11:23 AM, Johannes Sixt <j6t@kdbg.org> wrote:\n> Am 13.11.2014 um 23:40 schrieb Mike Blume:\n>> listed bug doesn't reproduce on Mac OS Yosemite. For now, just enable\n>> TTY on Yosemite and higher\n>>\n>> Signed-off-by: Mike Blume <blume.mike@gmail.com>\n>> Improved-by: Junio C Hamano <gitster@pobox.com>\n>> ---\n>>  t/lib-terminal.sh | 5 ++++-\n>>  1 file changed, 4 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/t/lib-terminal.sh b/t/lib-terminal.sh\n>> index 5184549..6395a34 100644\n>> --- a/t/lib-terminal.sh\n>> +++ b/t/lib-terminal.sh\n>> @@ -29,7 +29,10 @@ test_lazy_prereq TTY '\n>>       # After 2000 iterations or so it hangs.\n>>       # https://rt.cpan.org/Ticket/Display.html?id=65692\n>>       #\n>> -     test \"$(uname -s)\" != Darwin &&\n>> +     # Under Mac OS X 10.10.1 and Perl 5.18.2, this problem\n>> +     # appears to be gone.\n>> +     #\n>> +     test \"$(uname -s)\" != Darwin || test \"$(uname -r | cut -d. -f1)\" -ge 14 &&\n>\n> This is part of an &&-chain; you can't just throw in a || in the middle.\n>\n> How about\n>\n>         if test \"$(uname -s)\" = Darwin\n>         then\n>                 test \"$(uname -r | cut -d. -f1)\" -ge 14\n>         fi &&\n>\n>>\n>>       perl \"$TEST_DIRECTORY\"/test-terminal.perl \\\n>>               sh -c \"test -t 1 && test -t 2\"\n>>\n>\n> -- Hannes\n>\n"},{"id":"251902","messageId":"20141114200239.GA11581@peff.net","threadId":"37958","inReplyTo":"CAO2U3QgmuwatfDDO8f461cwq2SctPx+owL8gDMBpNyDcaxaWGQ@mail.gmail.com","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-11-14T20:02:39Z","receivedAt":"2014-11-14T20:02:39Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 14, 2014 at 11:48:36AM -0800, Michael Blume wrote:\n\n> My understanding is that && and || have equal precedence, and this\n> seems to be borne out in testing at my shell. If the if/then method is\n> clearer I'm happy to go with that.\n\nI think the problem is that there are earlier parts of the chain. It\ncurrently looks like:\n\n  foo &&\n  bar &&\n  do_something\n\nbut you are making it:\n\n  foo &&\n  bar || baz &&\n  do_something\n\nwhich will do_something whether or not \"foo\" is true. You need to put\nyour \"||\" at a lower precedence than the rest of the chain. The \"if\"\nthat Johannes mentioned works, though I think\n\n  test_have_prereq PERL &&\n  {\n    test \"$(uname -s)\" != Darwin ||\n    test \"$(uname -r | cut -d. -f1)\" -ge 13\n  } &&\n  ...\n\nis more obvious to read (but that's subjective, of course).\n\n-Peff\n"},{"id":"251905","messageId":"CAO2U3QhZrkmmCfFxKAcp+ojAso=ns6gA2g2TN5MZGdqCw0Y72A@mail.gmail.com","threadId":"37958","inReplyTo":"20141114200239.GA11581@peff.net","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-14T20:04:05Z","receivedAt":"2014-11-14T20:04:05Z","isPatch":true,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"Right, I missed that there was more going on above, thanks =)\n\nOn Fri, Nov 14, 2014 at 12:02 PM, Jeff King <peff@peff.net> wrote:\n> On Fri, Nov 14, 2014 at 11:48:36AM -0800, Michael Blume wrote:\n>\n>> My understanding is that && and || have equal precedence, and this\n>> seems to be borne out in testing at my shell. If the if/then method is\n>> clearer I'm happy to go with that.\n>\n> I think the problem is that there are earlier parts of the chain. It\n> currently looks like:\n>\n>   foo &&\n>   bar &&\n>   do_something\n>\n> but you are making it:\n>\n>   foo &&\n>   bar || baz &&\n>   do_something\n>\n> which will do_something whether or not \"foo\" is true. You need to put\n> your \"||\" at a lower precedence than the rest of the chain. The \"if\"\n> that Johannes mentioned works, though I think\n>\n>   test_have_prereq PERL &&\n>   {\n>     test \"$(uname -s)\" != Darwin ||\n>     test \"$(uname -r | cut -d. -f1)\" -ge 13\n>   } &&\n>   ...\n>\n> is more obvious to read (but that's subjective, of course).\n>\n> -Peff\n"},{"id":"251908","messageId":"xmqqfvdl35d0.fsf@gitster.dls.corp.google.com","threadId":"37958","inReplyTo":"20141114200239.GA11581@peff.net","subject":"Re: [PATCH v2] allow TTY tests to run under recent Mac OS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-14T20:16:27Z","receivedAt":"2014-11-14T20:16:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Fri, Nov 14, 2014 at 11:48:36AM -0800, Michael Blume wrote:\n>\n>> My understanding is that && and || have equal precedence, and this\n>> seems to be borne out in testing at my shell. If the if/then method is\n>> clearer I'm happy to go with that.\n>\n> I think the problem is that there are earlier parts of the chain. It\n> currently looks like:\n>\n>   foo &&\n>   bar &&\n>   do_something\n>\n> but you are making it:\n>\n>   foo &&\n>   bar || baz &&\n>   do_something\n>\n> which will do_something whether or not \"foo\" is true. You need to put\n> your \"||\" at a lower precedence than the rest of the chain. The \"if\"\n> that Johannes mentioned works, though I think\n>\n>   test_have_prereq PERL &&\n>   {\n>     test \"$(uname -s)\" != Darwin ||\n>     test \"$(uname -r | cut -d. -f1)\" -ge 13\n>   } &&\n>   ...\n>\n> is more obvious to read (but that's subjective, of course).\n\nThanks.\n\nWhile I was reading this earlier I wondered the same thing and\nconcluded it was OK based on the equal precedence, but like Michael\nI missed that there is yet another test before it.\n"}]}