{"thread":{"id":"4320","subject":"[PATCH] git-fetch: Shell syntax fix for NetBSD","startedAt":"2006-05-28T20:45:10Z","lastAt":"2006-05-28T21:28:03Z","messageCount":3,"participants":["Dennis Stosberg","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20835","messageId":"20060528204510.G51ab1cf8@leonov.stosberg.net","threadId":"4320","inReplyTo":null,"subject":"[PATCH] git-fetch: Shell syntax fix for NetBSD","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-05-28T20:45:10Z","receivedAt":"2006-05-28T20:45:10Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"NetBSD's default shell does not accept an opening parenthesis in\na case switch.\n\n$ ./git-fetch\n./git-fetch: 219: Syntax error: word unexpected (expecting \")\")\n\n---\nWith this change applied to the next branch, all tests complete\nsuccessfully on NetBSD 3.0 without having bash installed.\n\n git-fetch.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 280f62e..b8092a6 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -216,7 +216,7 @@ then\n \t          while read sha1 name\n \t\t  do\n \t\t\tcase \"$name\" in\n-\t\t\t(*^*) continue ;;\n+\t\t\t*^*) continue ;;\n \t\t\tesac\n \t\t  \tif git-check-ref-format \"$name\"\n \t\t\tthen\n-- \n1.3.3.g3c38f\n"},{"id":"20836","messageId":"7vbqthdfpa.fsf@assigned-by-dhcp.cox.net","threadId":"4320","inReplyTo":"20060528204510.G51ab1cf8@leonov.stosberg.net","subject":"Re: [PATCH] git-fetch: Shell syntax fix for NetBSD","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-05-28T21:04:01Z","receivedAt":"2006-05-28T21:04:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n> NetBSD's default shell does not accept an opening parenthesis in\n> a case switch.\n>\n> $ ./git-fetch\n> ./git-fetch: 219: Syntax error: word unexpected (expecting \")\")\n>\n> ---\n> With this change applied to the next branch, all tests complete\n> successfully on NetBSD 3.0 without having bash installed.\n\nFunny.  Without the posixy open parenthesis, bash barfs ;-).\n\n        git-fetch: line 219: syntax error near unexpected token `;;'\n        git-fetch: line 219: `                 *^*) continue ;;'\n\nSo how about doing this instead?  Does NetBSD default shell\nstill work with it?\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 280f62e..69bd810 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -211,12 +211,12 @@ # Otherwise we do what we always did.\n reflist=$(get_remote_refs_for_fetch \"$@\")\n if test \"$tags\"\n then\n-\ttaglist=$(IFS=\"\t\" &&\n+\ttaglist=`IFS=\"\t\" &&\n \t\t  git-ls-remote $upload_pack --tags \"$remote\" |\n \t          while read sha1 name\n \t\t  do\n \t\t\tcase \"$name\" in\n-\t\t\t(*^*) continue ;;\n+\t\t\t*^*) continue ;;\n \t\t\tesac\n \t\t  \tif git-check-ref-format \"$name\"\n \t\t\tthen\n@@ -224,7 +224,7 @@ then\n \t\t\telse\n \t\t\t    echo >&2 \"warning: tag ${name} ignored\"\n \t\t\tfi\n-\t\t  done)\n+\t\t  done`\n \tif test \"$#\" -gt 1\n \tthen\n \t\t# remote URL plus explicit refspecs; we need to merge them.\n"},{"id":"20838","messageId":"20060528212803.G53d5b45d@leonov.stosberg.net","threadId":"4320","inReplyTo":"7vbqthdfpa.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-fetch: Shell syntax fix for NetBSD","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-05-28T21:28:03Z","receivedAt":"2006-05-28T21:28:03Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> Funny.  Without the posixy open parenthesis, bash barfs ;-).\n> \n>         git-fetch: line 219: syntax error near unexpected token `;;'\n>         git-fetch: line 219: `                 *^*) continue ;;'\n> \n> So how about doing this instead?  Does NetBSD default shell\n> still work with it?\n\nThis looked so simple that I didn't notice the command\nsubstitution...\n\nYes, your version works correctly here.\n\nRegards,\nDennis\n"}]}