git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-fetch: Shell syntax fix for NetBSD
@ 2006-05-28 20:45 Dennis Stosberg
  2006-05-28 21:04 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Stosberg @ 2006-05-28 20:45 UTC (permalink / raw)
  To: git

NetBSD's default shell does not accept an opening parenthesis in
a case switch.

$ ./git-fetch
./git-fetch: 219: Syntax error: word unexpected (expecting ")")

---
With this change applied to the next branch, all tests complete
successfully on NetBSD 3.0 without having bash installed.

 git-fetch.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-fetch.sh b/git-fetch.sh
index 280f62e..b8092a6 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -216,7 +216,7 @@ then
 	          while read sha1 name
 		  do
 			case "$name" in
-			(*^*) continue ;;
+			*^*) continue ;;
 			esac
 		  	if git-check-ref-format "$name"
 			then
-- 
1.3.3.g3c38f

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-fetch: Shell syntax fix for NetBSD
  2006-05-28 20:45 [PATCH] git-fetch: Shell syntax fix for NetBSD Dennis Stosberg
@ 2006-05-28 21:04 ` Junio C Hamano
  2006-05-28 21:28   ` Dennis Stosberg
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-05-28 21:04 UTC (permalink / raw)
  To: Dennis Stosberg; +Cc: git

Dennis Stosberg <dennis@stosberg.net> writes:

> NetBSD's default shell does not accept an opening parenthesis in
> a case switch.
>
> $ ./git-fetch
> ./git-fetch: 219: Syntax error: word unexpected (expecting ")")
>
> ---
> With this change applied to the next branch, all tests complete
> successfully on NetBSD 3.0 without having bash installed.

Funny.  Without the posixy open parenthesis, bash barfs ;-).

        git-fetch: line 219: syntax error near unexpected token `;;'
        git-fetch: line 219: `                 *^*) continue ;;'

So how about doing this instead?  Does NetBSD default shell
still work with it?

diff --git a/git-fetch.sh b/git-fetch.sh
index 280f62e..69bd810 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -211,12 +211,12 @@ # Otherwise we do what we always did.
 reflist=$(get_remote_refs_for_fetch "$@")
 if test "$tags"
 then
-	taglist=$(IFS="	" &&
+	taglist=`IFS="	" &&
 		  git-ls-remote $upload_pack --tags "$remote" |
 	          while read sha1 name
 		  do
 			case "$name" in
-			(*^*) continue ;;
+			*^*) continue ;;
 			esac
 		  	if git-check-ref-format "$name"
 			then
@@ -224,7 +224,7 @@ then
 			else
 			    echo >&2 "warning: tag ${name} ignored"
 			fi
-		  done)
+		  done`
 	if test "$#" -gt 1
 	then
 		# remote URL plus explicit refspecs; we need to merge them.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-fetch: Shell syntax fix for NetBSD
  2006-05-28 21:04 ` Junio C Hamano
@ 2006-05-28 21:28   ` Dennis Stosberg
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Stosberg @ 2006-05-28 21:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Junio C Hamano wrote:

> Funny.  Without the posixy open parenthesis, bash barfs ;-).
> 
>         git-fetch: line 219: syntax error near unexpected token `;;'
>         git-fetch: line 219: `                 *^*) continue ;;'
> 
> So how about doing this instead?  Does NetBSD default shell
> still work with it?

This looked so simple that I didn't notice the command
substitution...

Yes, your version works correctly here.

Regards,
Dennis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-28 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-28 20:45 [PATCH] git-fetch: Shell syntax fix for NetBSD Dennis Stosberg
2006-05-28 21:04 ` Junio C Hamano
2006-05-28 21:28   ` Dennis Stosberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).