{"thread":{"id":"6586","subject":"[PATCH] Escape --upload-pack from expr.","startedAt":"2007-01-30T18:11:49Z","lastAt":"2007-01-30T19:19:03Z","messageCount":2,"participants":["Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"33060","messageId":"20070130181149.GA26655@spearce.org","threadId":"6586","inReplyTo":null,"subject":"[PATCH] Escape --upload-pack from expr.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-30T18:11:49Z","receivedAt":"2007-01-30T18:11:49Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Recent commit ae1dffcb28ee89a23f8d2747be65e17c8eab1690 by Junio\nchanged the way --upload-pack was passed around between clone,\nfetch and ls-remote and modified the handling of the command\nline parameter parsing.\n\nUnfortunately FreeBSD 6.1 insists that the expression\n\n  expr --upload-pack=git-upload-pack : '-[^=]*=\\(.*\\)'\n\nis illegal, as the --upload-pack option is not supported by their\nimplementation of expr.\n\nElsewhere in Git we use z as a leading prefix of both arguments,\nensuring the -- isn't seen by expr.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n I did a quick search, I don't think there are any others.\n\n git-clone.sh     |    2 +-\n git-fetch.sh     |    2 +-\n git-ls-remote.sh |    2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 3d83acb..4ddfa77 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -123,7 +123,7 @@ while\n \t\tshift\n \t\tupload_pack=\"--upload-pack=$1\" ;;\n \t*,--upload-pack=*)\n-\t\tupload_pack=--upload-pack=$(expr \"$1\" : '-[^=]*=\\(.*\\)') ;;\n+\t\tupload_pack=--upload-pack=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n \t1,--depth) usage;;\n \t*,--depth)\n \t\tshift\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex c1f6e1e..357cac2 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -37,7 +37,7 @@ do\n \t\t;;\n \t--upl=*|--uplo=*|--uploa=*|--upload=*|\\\n \t--upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)\n-\t\texec=--upload-pack=$(expr \"$1\" : '-[^=]*=\\(.*\\)')\n+\t\texec=--upload-pack=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)')\n \t\tshift\n \t\t;;\n \t-f|--f|--fo|--for|--forc|--force)\ndiff --git a/git-ls-remote.sh b/git-ls-remote.sh\nindex e6f574b..8ea5c5e 100755\n--- a/git-ls-remote.sh\n+++ b/git-ls-remote.sh\n@@ -27,7 +27,7 @@ do\n \tshift;;\n   -u=*|--u=*|--up=*|--upl=*|--uplo=*|--uploa=*|--upload=*|\\\n   --upload-=*|--upload-p=*|--upload-pa=*|--upload-pac=*|--upload-pack=*)\n-\texec=--upload-pack=$(expr \"$1\" : '-[^=]*=\\(.*\\)')\n+\texec=--upload-pack=$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)')\n \tshift;;\n   --)\n   shift; break ;;\n-- \n1.5.0.rc2.81.g73a2\n"},{"id":"33074","messageId":"7v4pq8z5js.fsf@assigned-by-dhcp.cox.net","threadId":"6586","inReplyTo":"20070130181149.GA26655@spearce.org","subject":"Re: [PATCH] Escape --upload-pack from expr.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-30T19:19:03Z","receivedAt":"2007-01-30T19:19:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Good catch; thanks.\n"}]}