{"thread":{"id":"13044","subject":"[PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.","startedAt":"2008-04-10T07:25:00Z","lastAt":"2008-04-10T08:34:25Z","messageCount":3,"participants":["Adam Golebiowski","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"74038","messageId":"20080410072500.GA10188@mysza.eu.org","threadId":"13044","inReplyTo":null,"subject":"[PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.","fromName":"Adam Golebiowski","fromEmail":"adamg@pld-linux.org","sentAt":"2008-04-10T07:25:00Z","receivedAt":"2008-04-10T07:25:00Z","isPatch":true,"sender":{"key":"adamg@pld-linux.org","avatar":null},"body":"On systems with /bin/sh being different than /bin/bash, make test fails due\nto some bash-specific constructs. This patch makes it possible to run the\ntest-suite systems with on /bin/sh pointing to /bin/ksh.\n\nSigned-off-by: Adam Golebiowski <adamg@pld-linux.org>\n---\n t/t3200-branch.sh |    2 +-\n t/t7201-co.sh     |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex cb5f7a4..e8ff82f 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -200,7 +200,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'branch from non-branch HEAD w/--track causes failure' \\\n-    '!(git branch --track my10 HEAD^)'\n+    '! git branch --track my10 HEAD^'\n \n # Keep this test last, as it changes the current branch\n cat >expect <<EOF\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 3111baa..51a9928 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -335,6 +335,6 @@ test_expect_success \\\n     git checkout -b delete-me master &&\n     rm .git/refs/heads/delete-me &&\n     test refs/heads/delete-me = \"$(git symbolic-ref HEAD)\" &&\n-    !(git checkout --track -b track)'\n+    ! git checkout --track -b track'\n \n test_done\n-- \n1.5.4.5\n\n\n-- \n http://www.mysza.eu.org/ | Everybody needs someone sure, someone true,\n   PLD Linux developer    | Everybody needs some solid rock, I know I do.\n"},{"id":"74041","messageId":"20080410081108.GA15858@sigill.intra.peff.net","threadId":"13044","inReplyTo":"20080410072500.GA10188@mysza.eu.org","subject":"Re: [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-04-10T08:11:09Z","receivedAt":"2008-04-10T08:11:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Apr 10, 2008 at 09:25:00AM +0200, Adam Golebiowski wrote:\n\n> -    '!(git branch --track my10 HEAD^)'\n> +    '! git branch --track my10 HEAD^'\n\nThese should probably be using the new test_must_fail instead of '!'\nanyway.\n\n-Peff\n"},{"id":"74043","messageId":"7v63uqxg4u.fsf@gitster.siamese.dyndns.org","threadId":"13044","inReplyTo":"20080410072500.GA10188@mysza.eu.org","subject":"Re: [PATCH] Kill bashizm in t/t3200-branch.sh and t/t7201-co.sh.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-10T08:34:25Z","receivedAt":"2008-04-10T08:34:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Adam Golebiowski <adamg@pld-linux.org> writes:\n\n> On systems with /bin/sh being different than /bin/bash, make test fails due\n> to some bash-specific constructs. This patch makes it possible to run the\n> test-suite systems with on /bin/sh pointing to /bin/ksh.\n>\n> Signed-off-by: Adam Golebiowski <adamg@pld-linux.org>\n> ---\n>  t/t3200-branch.sh |    2 +-\n>  t/t7201-co.sh     |    2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\n> index cb5f7a4..e8ff82f 100755\n> --- a/t/t3200-branch.sh\n> +++ b/t/t3200-branch.sh\n> @@ -200,7 +200,7 @@ test_expect_success \\\n>  \n>  test_expect_success \\\n>      'branch from non-branch HEAD w/--track causes failure' \\\n> -    '!(git branch --track my10 HEAD^)'\n> +    '! git branch --track my10 HEAD^'\n\nI do not think you need a subshell for this particular test, so your\nchange would not be making anything worse, but I do not see a point.\n\nIt is a plain vanilla POSIX shell construct; \"! ( compound_list )\" is not a\nbash-ism at all.\n\nhttp://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_10\n\n> diff --git a/t/t7201-co.sh b/t/t7201-co.sh\n> index 3111baa..51a9928 100755\n> --- a/t/t7201-co.sh\n> +++ b/t/t7201-co.sh\n> @@ -335,6 +335,6 @@ test_expect_success \\\n>      git checkout -b delete-me master &&\n>      rm .git/refs/heads/delete-me &&\n>      test refs/heads/delete-me = \"$(git symbolic-ref HEAD)\" &&\n> -    !(git checkout --track -b track)'\n> +    ! git checkout --track -b track'\n\nSame comments apply.\n\nHaving said that, as both of these tests are trying to make sure that the\ncommand fails gracefully (iow, say \"failure\" and refuse, instead of\nbarfing and dumping core), they could probably use test_must_fail, like\nthis:\n\n     git checkout -b delete-me master &&\n     rm .git/refs/heads/delete-me &&\n     test refs/heads/delete-me = \"$(git symbolic-ref HEAD)\" &&\n-    !(git checkout --track -b track)'\n+    test_must_fail git checkout --track -b track'\n"}]}