{"thread":{"id":"30633","subject":"[PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator","startedAt":"2012-05-26T16:51:23Z","lastAt":"2012-05-27T07:01:44Z","messageCount":4,"participants":["Ramsay Jones","Jon Seymour","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"192249","messageId":"4FC10A0B.5080407@ramsay1.demon.co.uk","threadId":"30633","inReplyTo":null,"subject":"[PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-05-26T16:51:23Z","receivedAt":"2012-05-26T16:51:23Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSome shells, including dash, do not support using the '==' string\nequality operator. This results in the failure of tests 7-12 with\n'test' complaining of an \"unexpected operator\".\n\nIn order to suppress the errors, we replace the '==' operator with\n'=', which must be supported by any POSIX shell.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Jon,\n\nIf you need to re-roll your patches from the 'js/submodule-relative'\nbranch (commits 3f4542e and efa4c90), could you please squash this\nfix into them.\n\nThanks!\n\nATB,\nRamsay Jones\n\n t/t7403-submodule-sync.sh |   12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nindex 583fe21..3d85739 100755\n--- a/t/t7403-submodule-sync.sh\n+++ b/t/t7403-submodule-sync.sh\n@@ -93,7 +93,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form foo' '\n \t git remote set-url origin foo\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../submodule\"\n \t)\n \t)\n '\n@@ -103,7 +103,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form foo/bar\n \t git remote set-url origin foo/bar\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../foo/submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../foo/submodule\"\n \t)\n \t)\n '\n@@ -113,7 +113,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form ./foo'\n \t git remote set-url origin ./foo\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../submodule\"\n \t)\n \t)\n '\n@@ -123,7 +123,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form ./foo/b\n \t git remote set-url origin ./foo/bar\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../foo/submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../foo/submodule\"\n \t)\n \t)\n '\n@@ -133,7 +133,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form ../foo'\n \t git remote set-url origin ../foo\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../../submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../../submodule\"\n \t)\n \t)\n '\n@@ -143,7 +143,7 @@ test_expect_success '\"git submodule sync\" handles origin URL of the form ../foo/\n \t git remote set-url origin ../foo/bar\n \t git submodule sync &&\n \t(cd submodule &&\n-\t test \"$(git config remote.origin.url)\" == \"../../foo/submodule\"\n+\t test \"$(git config remote.origin.url)\" = \"../../foo/submodule\"\n \t)\n \t)\n '\n-- \n1.7.10\n"},{"id":"192253","messageId":"CAH3AnrqgfjjpN3V10y0v1tMGZ3f5G-RjL5LV9he-0sdbvrMLNQ@mail.gmail.com","threadId":"30633","inReplyTo":"4FC10A0B.5080407@ramsay1.demon.co.uk","subject":"Re: [PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-26T22:21:48Z","receivedAt":"2012-05-26T22:21:48Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 27, 2012 at 2:51 AM, Ramsay Jones\n<ramsay@ramsay1.demon.co.uk> wrote:\n>\n> Some shells, including dash, do not support using the '==' string\n> equality operator. This results in the failure of tests 7-12 with\n> 'test' complaining of an \"unexpected operator\".\n>\n> In order to suppress the errors, we replace the '==' operator with\n> '=', which must be supported by any POSIX shell.\n>\n\nThanks. I take it than an example of such a shell is dash?\n\nBTW: the next iteration is more of a re-write than a re-roll because I\nnoticed some other issues (e.g. preventing git://hostname/repo being\nsilently transformed to git://subrepo in the case of a pathological\nuse of a submodule URL of the form ../../subrepo) and fixing this\nrequired a change that required a more extensive suite of tests.\n\n\njon.\n"},{"id":"192261","messageId":"7vfwamp11u.fsf@alter.siamese.dyndns.org","threadId":"30633","inReplyTo":"4FC10A0B.5080407@ramsay1.demon.co.uk","subject":"Re: [PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-05-27T06:53:33Z","receivedAt":"2012-05-27T06:53:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Some shells, including dash, do not support using the '==' string\n> equality operator. This results in the failure of tests 7-12 with\n> 'test' complaining of an \"unexpected operator\".\n\nThanks.  You do not have to single-out dash.\nA shell script that uses \"test $a == $b\" is *buggy* and not conforming to\nPOSIX.\n"},{"id":"192262","messageId":"CAH3AnrrbsQYvwUuEEwb-E7sV_odGPE7pEFXNZd+SbbGs+1-vLQ@mail.gmail.com","threadId":"30633","inReplyTo":"7vfwamp11u.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t7403-*.sh: Avoid use of the nonportable '==' operator","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2012-05-27T07:01:44Z","receivedAt":"2012-05-27T07:01:44Z","isPatch":true,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"On Sun, May 27, 2012 at 4:53 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>\n>> Some shells, including dash, do not support using the '==' string\n>> equality operator. This results in the failure of tests 7-12 with\n>> 'test' complaining of an \"unexpected operator\".\n>\n> Thanks.  You do not have to single-out dash.\n> A shell script that uses \"test $a == $b\" is *buggy* and not conforming to\n> POSIX.\n\nYep. This slipped through because I happen to have reconfigured my\n/bin/sh to point to bash (frrom Ubuntu's default of dash) because of\nan issue with a product installation script. This shouldn't have been\na problem if bash's POSIX mode was strict about rejecting == but bash\ndoesn't seem to be strict about this.\n\nAnyway, I have reverted /bin/sh to refer to dash so hopefully I won't\nbe caught by this in future.\n\njon.\n"}]}