{"thread":{"id":"30189","subject":"[PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","startedAt":"2012-04-09T20:13:29Z","lastAt":"2012-04-19T20:06:53Z","messageCount":5,"participants":["Ben Walton","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"188817","messageId":"1334002409-5708-1-git-send-email-bwalton@artsci.utoronto.ca","threadId":"30189","inReplyTo":null,"subject":"[PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2012-04-09T20:13:29Z","receivedAt":"2012-04-09T20:13:29Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"The grep in Solaris' /usr/xpg4/bin as found by the default\nSANE_TOOL_PATH was not properly handling the 'cvs co -c (shows module\ndatabase)' test.  The [\\t ] character set selection does not properly\ntrigger so the first grep in the test fails.\n\nInstead of working around this issue, switch to using the standard\ntest_cmp() shell function to perform the comparison instead.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n\nIt's possible that the specific pair of grep statements is required.\nIt's looking for tab or space, so maybe we get either character in\nsome cases, depending on cvs version?  This passed the test suite\nusing cvs 1.12.13 for OpenCSW.\n\nIf there is a reason for the original construction, I'll find a more\ncreative work around for this problem.\n\n t/t9400-git-cvsserver-server.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 9199550..df1405f 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '\n cd \"$WORKDIR\"\n test_expect_success 'cvs co -c (shows module database)' '\n     GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n-    grep \"^master[\t ]\\+master$\" < out &&\n-    ! grep -v \"^master[\t ]\\+master$\" < out\n+    echo \"master\tmaster\" > out.expected &&\n+    test_cmp out out.expected\n '\n \n #------------\n-- \n1.7.9\n"},{"id":"189303","messageId":"1334445524-sup-1455@pinkfloyd.chass.utoronto.ca","threadId":"30189","inReplyTo":"1334002409-5708-1-git-send-email-bwalton@artsci.utoronto.ca","subject":"Re: [PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2012-04-14T23:19:29Z","receivedAt":"2012-04-14T23:19:29Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Ben Walton's message of Mon Apr 09 16:13:29 -0400 2012:\n\nBump?\n\nThanks\n-Ben\n\n> The grep in Solaris' /usr/xpg4/bin as found by the default\n> SANE_TOOL_PATH was not properly handling the 'cvs co -c (shows module\n> database)' test.  The [\\t ] character set selection does not properly\n> trigger so the first grep in the test fails.\n> \n> Instead of working around this issue, switch to using the standard\n> test_cmp() shell function to perform the comparison instead.\n> \n> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n> ---\n> \n> It's possible that the specific pair of grep statements is required.\n> It's looking for tab or space, so maybe we get either character in\n> some cases, depending on cvs version?  This passed the test suite\n> using cvs 1.12.13 for OpenCSW.\n> \n> If there is a reason for the original construction, I'll find a more\n> creative work around for this problem.\n> \n>  t/t9400-git-cvsserver-server.sh |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n> index 9199550..df1405f 100755\n> --- a/t/t9400-git-cvsserver-server.sh\n> +++ b/t/t9400-git-cvsserver-server.sh\n> @@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '\n>  cd \"$WORKDIR\"\n>  test_expect_success 'cvs co -c (shows module database)' '\n>      GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n> -    grep \"^master[     ]\\+master$\" < out &&\n> -    ! grep -v \"^master[     ]\\+master$\" < out\n> +    echo \"master    master\" > out.expected &&\n> +    test_cmp out out.expected\n>  '\n>  \n>  #------------\n--\nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"189710","messageId":"xmqqfwbzslt2.fsf@junio.mtv.corp.google.com","threadId":"30189","inReplyTo":"1334445524-sup-1455@pinkfloyd.chass.utoronto.ca","subject":"Re: [PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","fromName":"Junio C Hamano","fromEmail":"jch@google.com","sentAt":"2012-04-19T16:55:53Z","receivedAt":"2012-04-19T16:55:53Z","isPatch":true,"sender":{"key":"jch@google.com","avatar":null},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> Excerpts from Ben Walton's message of Mon Apr 09 16:13:29 -0400 2012:\n>\n> Bump?\n> ...\n>> It's possible that the specific pair of grep statements is required.\n>> It's looking for tab or space, so maybe we get either character in\n>> some cases, depending on cvs version?\n\nBump, anybody, on this point?\n\n>> If there is a reason for the original construction, I'll find a more\n>> creative work around for this problem.\n>> \n>>  t/t9400-git-cvsserver-server.sh |    4 ++--\n>>  1 files changed, 2 insertions(+), 2 deletions(-)\n>> \n>> diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\n>> index 9199550..df1405f 100755\n>> --- a/t/t9400-git-cvsserver-server.sh\n>> +++ b/t/t9400-git-cvsserver-server.sh\n>> @@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '\n>>  cd \"$WORKDIR\"\n>>  test_expect_success 'cvs co -c (shows module database)' '\n>>      GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n>> -    grep \"^master[     ]\\+master$\" < out &&\n>> -    ! grep -v \"^master[     ]\\+master$\" < out\n\nIs it really the character class, or is it the GNUism \"\\+\", that breaks\nthis?\n\nIn other words, does it work if you patch it like this instead?\n\n t/t9400-git-cvsserver-server.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 9199550..173bf3d 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '\n cd \"$WORKDIR\"\n test_expect_success 'cvs co -c (shows module database)' '\n     GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n-    grep \"^master[\t ]\\+master$\" < out &&\n-    ! grep -v \"^master[\t ]\\+master$\" < out\n+    grep \"^master[\t ][ \t]*master$\" <out &&\n+    ! grep -v \"^master[\t ][ \t]*master$\" <out\n '\n \n #------------\n"},{"id":"189713","messageId":"1334857109-sup-7979@pinkfloyd.chass.utoronto.ca","threadId":"30189","inReplyTo":"xmqqfwbzslt2.fsf@junio.mtv.corp.google.com","subject":"Re: [PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2012-04-19T17:39:06Z","receivedAt":"2012-04-19T17:39:06Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Junio C Hamano's message of Thu Apr 19 12:55:53 -0400 2012:\n\n> Is it really the character class, or is it the GNUism \"\\+\", that breaks\n> this?\n\nYes, you're right, it is the \\+.  I didn't look carefully enough when\nI saw that test_cmp looked like the way to fix this.\n\nI'll re-word the patch...\n\n> In other words, does it work if you patch it like this instead?\n\n> -    grep \"^master[     ]\\+master$\" < out &&\n> -    ! grep -v \"^master[     ]\\+master$\" < out\n> +    grep \"^master[     ][     ]*master$\" <out &&\n> +    ! grep -v \"^master[     ][     ]*master$\" <out\n>  '\n\nThis does work and if there is some significance to the space or tab\nthen it's a better patch.\n\nThanks\n-Ben\n--\nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"189724","messageId":"xmqqlilrv63m.fsf@junio.mtv.corp.google.com","threadId":"30189","inReplyTo":"1334857109-sup-7979@pinkfloyd.chass.utoronto.ca","subject":"Re: [PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-04-19T20:06:53Z","receivedAt":"2012-04-19T20:06:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> This does work and if there is some significance to the space or tab\n> then it's a better patch.\n\nOk, I'll queue this:\n\n-- >8 --\nFrom: Junio C Hamano <gitster@pobox.com>\nSubject: [PATCH] t9400: fix gnuism in grep\n\nUsing \"\\+\" in \"grep\" and expecting that it means one or more\nis a GNUism.  Spell it in a dumb and portable way.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t9400-git-cvsserver-server.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh\nindex 9199550..173bf3d 100755\n--- a/t/t9400-git-cvsserver-server.sh\n+++ b/t/t9400-git-cvsserver-server.sh\n@@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '\n cd \"$WORKDIR\"\n test_expect_success 'cvs co -c (shows module database)' '\n     GIT_CONFIG=\"$git_config\" cvs co -c > out &&\n-    grep \"^master[\t ]\\+master$\" < out &&\n-    ! grep -v \"^master[\t ]\\+master$\" < out\n+    grep \"^master[\t ][ \t]*master$\" <out &&\n+    ! grep -v \"^master[\t ][ \t]*master$\" <out\n '\n \n #------------\n-- \n1.7.10.282.g21208e\n"}]}