{"thread":{"id":"7899","subject":"[StGIT PATCH 2/2] dash doesn't do curly brace expansion, so avoid that","startedAt":"2007-04-29T21:09:45Z","lastAt":"2007-04-30T07:08:28Z","messageCount":5,"participants":["Karl Hasselström","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"40719","messageId":"20070429210713.4004.60467.stgit@yoghurt","threadId":"7899","inReplyTo":null,"subject":"[StGIT PATCH 0/2] Make test suite work with dash as /bin/sh","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-04-29T21:09:45Z","receivedAt":"2007-04-29T21:09:45Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"I got some strange errors when running the StGIT test suite on a\nmachine I hadn't tried developing on before. It turned out that its\n/bin/sh was dash, and that a few bashisms needed fixing.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"40720","messageId":"20070429210950.4004.86948.stgit@yoghurt","threadId":"7899","inReplyTo":"20070429210713.4004.60467.stgit@yoghurt","subject":"[StGIT PATCH 1/2] String comparison is done with \"=\", not \"==\"","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-04-29T21:09:50Z","receivedAt":"2007-04-29T21:09:50Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nThe \"test\" builtin in bash accepts both \"==\" and \"=\", but it didn't\nwork with dash as /bin/sh.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n t/t1300-uncommit.sh |    8 ++++----\n t/t1800-import.sh   |   26 +++++++++++++-------------\n t/t1900-mail.sh     |    2 +-\n t/t2000-sync.sh     |   14 +++++++-------\n 4 files changed, 25 insertions(+), 25 deletions(-)\n\ndiff --git a/t/t1300-uncommit.sh b/t/t1300-uncommit.sh\nindex 497c354..519234e 100755\n--- a/t/t1300-uncommit.sh\n+++ b/t/t1300-uncommit.sh\n@@ -42,7 +42,7 @@ test_expect_success \\\n \t'Uncommit the patches using names' \\\n \t'\n \tstg uncommit bar foo &&\n-\t[ \"$(stg id foo//top)\" == \"$(stg id bar//bottom)\" ] &&\n+\t[ \"$(stg id foo//top)\" = \"$(stg id bar//bottom)\" ] &&\n \tstg commit\n \t'\n \n@@ -50,7 +50,7 @@ test_expect_success \\\n \t'Uncommit the patches using prefix' \\\n \t'\n \tstg uncommit --number=2 foobar &&\n-\t[ \"$(stg id foobar1//top)\" == \"$(stg id foobar2//bottom)\" ] &&\n+\t[ \"$(stg id foobar1//top)\" = \"$(stg id foobar2//bottom)\" ] &&\n \tstg commit\n \t'\n \n@@ -58,7 +58,7 @@ test_expect_success \\\n \t'Uncommit the patches using auto names' \\\n \t'\n \tstg uncommit --number=2 &&\n-\t[ \"$(stg id foo-patch//top)\" == \"$(stg id bar-patch//bottom)\" ] &&\n+\t[ \"$(stg id foo-patch//top)\" = \"$(stg id bar-patch//bottom)\" ] &&\n \tstg commit\n \t'\n \n@@ -67,7 +67,7 @@ test_expect_success \\\n \t'\n \tstg uncommit &&\n \tstg uncommit &&\n-\t[ \"$(stg id foo-patch//top)\" == \"$(stg id bar-patch//bottom)\" ] &&\n+\t[ \"$(stg id foo-patch//top)\" = \"$(stg id bar-patch//bottom)\" ] &&\n \tstg commit\n \t'\n test_done\ndiff --git a/t/t1800-import.sh b/t/t1800-import.sh\nindex 0c1baa3..ed10fa8 100755\n--- a/t/t1800-import.sh\n+++ b/t/t1800-import.sh\n@@ -19,7 +19,7 @@ test_expect_success \\\n     '\n     stg import ../t1800-import/git-diff &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") == 1 ] &&\n+        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") = 1 ] &&\n     stg delete ..\n     '\n \n@@ -28,7 +28,7 @@ test_expect_success \\\n     '\n     stg import ../t1800-import/gnu-diff &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") == 1 ] &&\n+        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") = 1 ] &&\n     stg delete ..\n     '\n \n@@ -37,7 +37,7 @@ test_expect_success \\\n     '\n     stg import ../t1800-import/stg-export &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") == 1 ] &&\n+        | grep -c \"tree e96b1fba2160890ff600b675d7140d46b022b155\") = 1 ] &&\n     stg delete ..\n     '\n \n@@ -46,9 +46,9 @@ test_expect_success \\\n     '\n     stg import -m ../t1800-import/email-8bit &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"tree 030be42660323ff2a1958f9ee79589a4f3fbee2f\") == 1 ] &&\n+        | grep -c \"tree 030be42660323ff2a1958f9ee79589a4f3fbee2f\") = 1 ] &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"author Inge Ström <inge@power.com>\") == 1 ] &&\n+        | grep -c \"author Inge Ström <inge@power.com>\") = 1 ] &&\n     stg delete ..\n     '\n \n@@ -57,9 +57,9 @@ test_expect_success \\\n     '\n     stg import -m ../t1800-import/email-qp &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"tree 030be42660323ff2a1958f9ee79589a4f3fbee2f\") == 1 ] &&\n+        | grep -c \"tree 030be42660323ff2a1958f9ee79589a4f3fbee2f\") = 1 ] &&\n     [ $(git cat-file -p $(stg id) \\\n-        | grep -c \"author Inge Ström <inge@power.com>\") == 1 ] &&\n+        | grep -c \"author Inge Ström <inge@power.com>\") = 1 ] &&\n     stg delete ..\n     '\n \n@@ -68,17 +68,17 @@ test_expect_success \\\n     '\n     stg import -M ../t1800-import/email-mbox &&\n     [ $(git cat-file -p $(stg id change-1) \\\n-        | grep -c \"tree 401bef82cd9fb403aba18f480a63844416a2e023\") == 1 ] &&\n+        | grep -c \"tree 401bef82cd9fb403aba18f480a63844416a2e023\") = 1 ] &&\n     [ $(git cat-file -p $(stg id change-1) \\\n-        | grep -c \"author Inge Ström <inge@power.com>\") == 1 ] &&\n+        | grep -c \"author Inge Ström <inge@power.com>\") = 1 ] &&\n     [ $(git cat-file -p $(stg id change-2) \\\n-        | grep -c \"tree e49dbce010ec7f441015a8c64bce0b99108af4cc\") == 1 ] &&\n+        | grep -c \"tree e49dbce010ec7f441015a8c64bce0b99108af4cc\") = 1 ] &&\n     [ $(git cat-file -p $(stg id change-2) \\\n-        | grep -c \"author Inge Ström <inge@power.com>\") == 1 ] &&\n+        | grep -c \"author Inge Ström <inge@power.com>\") = 1 ] &&\n     [ $(git cat-file -p $(stg id change-3) \\\n-        | grep -c \"tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5\") == 1 ] &&\n+        | grep -c \"tree 166bbaf27a44aee21ba78c98822a741e6f7d78f5\") = 1 ] &&\n     [ $(git cat-file -p $(stg id change-3) \\\n-        | grep -c \"author Inge Ström <inge@power.com>\") == 1 ] &&\n+        | grep -c \"author Inge Ström <inge@power.com>\") = 1 ] &&\n     stg delete ..\n     '\n \ndiff --git a/t/t1900-mail.sh b/t/t1900-mail.sh\nindex 3eed7f8..78050db 100755\n--- a/t/t1900-mail.sh\n+++ b/t/t1900-mail.sh\n@@ -29,7 +29,7 @@ test_expect_success \\\n     stg pop -a &&\n     stg import -M mbox0 &&\n     t2=$(git cat-file -p $(stg id) | grep ^tree) &&\n-    [ \"$t1\" == \"$t2\" ]\n+    [ \"$t1\" = \"$t2\" ]\n     '\n \n test_done\ndiff --git a/t/t2000-sync.sh b/t/t2000-sync.sh\nindex 3dd1cd6..02345bb 100755\n--- a/t/t2000-sync.sh\n+++ b/t/t2000-sync.sh\n@@ -47,7 +47,7 @@ test_expect_success \\\n     '\n     stg sync -b master p2 &&\n     test $(stg applied -c) -eq 3 &&\n-    test $(cat foo2.txt) == \"foo2\"\n+    test $(cat foo2.txt) = \"foo2\"\n     '\n \n test_expect_success \\\n@@ -55,8 +55,8 @@ test_expect_success \\\n     '\n     stg sync -b master -a &&\n     test $(stg applied -c) -eq 3 &&\n-    test $(cat foo1.txt) == \"foo1\" &&\n-    test $(cat foo2.txt) == \"foo2\"\n+    test $(cat foo1.txt) = \"foo1\" &&\n+    test $(cat foo2.txt) = \"foo2\"\n     '\n \n test_expect_success \\\n@@ -64,9 +64,9 @@ test_expect_success \\\n     '\n     stg sync -s patches-master/series -a &&\n     test $(stg applied -c) -eq 3 &&\n-    test $(cat foo1.txt) == \"foo1\" &&\n-    test $(cat foo2.txt) == \"foo2\" &&\n-    test $(cat foo3.txt) == \"foo3\"\n+    test $(cat foo1.txt) = \"foo1\" &&\n+    test $(cat foo2.txt) = \"foo2\" &&\n+    test $(cat foo3.txt) = \"foo3\"\n     '\n \n test_expect_success \\\n@@ -92,7 +92,7 @@ test_expect_success \\\n     '\n     stg sync -b master p2 &&\n     test $(stg applied -c) -eq 3 &&\n-    test $(cat bar2.txt) == \"bar2\"\n+    test $(cat bar2.txt) = \"bar2\"\n     '\n \n test_expect_failure \\\n"},{"id":"40718","messageId":"20070429210955.4004.31074.stgit@yoghurt","threadId":"7899","inReplyTo":"20070429210713.4004.60467.stgit@yoghurt","subject":"[StGIT PATCH 2/2] dash doesn't do curly brace expansion, so avoid that","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-04-29T21:09:55Z","receivedAt":"2007-04-29T21:09:55Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nI have dash as /bin/sh, and it doesn't seem to expand stuff in curly\nbraces, which breaks t1800. Work around this by not using curly brace\nexpansion to generate test data.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n t/t1800-import.sh      |    4 +---\n t/t1800-import/foo.txt |   27 +++++++++++++++++++++++++++\n 2 files changed, 28 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1800-import.sh b/t/t1800-import.sh\nindex ed10fa8..8c8c9a0 100755\n--- a/t/t1800-import.sh\n+++ b/t/t1800-import.sh\n@@ -6,9 +6,7 @@ test_description='Test the import command'\n test_expect_success \\\n     'Initialize the StGIT repository' \\\n     '\n-    for x in {do,di,da}{be,bi,bo}{dam,dim,dum}; do\n-      echo $x\n-    done > foo.txt &&\n+    cp ../t1800-import/foo.txt . &&\n     git add foo.txt &&\n     git commit -a -m \"initial version\" &&\n     stg init\ndiff --git a/t/t1800-import/foo.txt b/t/t1800-import/foo.txt\nnew file mode 100644\nindex 0000000..ad01662\n--- /dev/null\n+++ b/t/t1800-import/foo.txt\n@@ -0,0 +1,27 @@\n+dobedam\n+dobedim\n+dobedum\n+dobidam\n+dobidim\n+dobidum\n+dobodam\n+dobodim\n+dobodum\n+dibedam\n+dibedim\n+dibedum\n+dibidam\n+dibidim\n+dibidum\n+dibodam\n+dibodim\n+dibodum\n+dabedam\n+dabedim\n+dabedum\n+dabidam\n+dabidim\n+dabidum\n+dabodam\n+dabodim\n+dabodum\n"},{"id":"40724","messageId":"b0943d9e0704291544h2e4225d2jb32925bdca584e98@mail.gmail.com","threadId":"7899","inReplyTo":"20070429210713.4004.60467.stgit@yoghurt","subject":"Re: [StGIT PATCH 0/2] Make test suite work with dash as /bin/sh","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-04-29T22:44:24Z","receivedAt":"2007-04-29T22:44:24Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 30/04/07, Karl Hasselström <kha@treskal.com> wrote:\n> I got some strange errors when running the StGIT test suite on a\n> machine I hadn't tried developing on before. It turned out that its\n> /bin/sh was dash, and that a few bashisms needed fixing.\n\nThanks for your patches. I'll apply them in about 2 weeks time (when I\nget back to the UK).\n\n-- \nCatalin\n"},{"id":"40735","messageId":"20070430070828.GA4981@diana.vm.bytemark.co.uk","threadId":"7899","inReplyTo":"b0943d9e0704291544h2e4225d2jb32925bdca584e98@mail.gmail.com","subject":"Re: [StGIT PATCH 0/2] Make test suite work with dash as /bin/sh","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-04-30T07:08:28Z","receivedAt":"2007-04-30T07:08:28Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-04-30 01:44:24 +0300, Catalin Marinas wrote:\n\n> Thanks for your patches. I'll apply them in about 2 weeks time (when\n> I get back to the UK).\n\nThanks. Does that mean that you have no objections to my war on\nredundant metadata?\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}