{"thread":{"id":"43441","subject":"[PATCH] git-fetch.sh printed protocol fix","startedAt":"2006-10-25T10:03:06Z","lastAt":"2006-10-25T18:52:09Z","messageCount":2,"participants":["Tuncer Ayaz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"294796","messageId":"4ac8254d0610250303n60a6006bsa4d77aba7255485f@mail.gmail.com","threadId":"43441","inReplyTo":null,"subject":"[PATCH] git-fetch.sh printed protocol fix","fromName":"Tuncer Ayaz","fromEmail":"tuncer.ayaz@gmail.com","sentAt":"2006-10-25T10:03:06Z","receivedAt":"2006-10-25T10:03:06Z","isPatch":true,"sender":{"key":"tuncer.ayaz@gmail.com","avatar":null},"body":"As a feature I wished for (ftp:// support in git-fetch) was added in 1.4.3\nI tested that feature and found a minor logging issue. The mini-patch\nbelow fixes that.  AFAIK the pattern expansion feature I've used should\nbe available in any current /bin/sh. If not we will have to find another\nway to print the protocol part of the used fetch URL.\n\n--- git-core-1.4.3.2/git-fetch.sh\t2006-10-24 07:29:47.000000000 +0200\n+++ git-core-1.4.3.2.tma/git-fetch.sh\t2006-10-25 11:44:34.000000000 +0200\n@@ -310,7 +310,7 @@\n \t  done\n  \t  expr \"z$head\" : \"z$_x40\\$\" >/dev/null ||\n \t      die \"Failed to fetch $remote_name from $remote\"\n-\t  echo >&2 Fetching \"$remote_name from $remote\" using http\n+\t  echo >&2 Fetching \"$remote_name from $remote\" using ${remote%%:*}\n \t  git-http-fetch -v -a \"$head\" \"$remote/\" || exit\n \t  ;;\n"},{"id":"295371","messageId":"7v4ptsb546.fsf@assigned-by-dhcp.cox.net","threadId":"43441","inReplyTo":"4ac8254d0610250303n60a6006bsa4d77aba7255485f@mail.gmail.com","subject":"Re: [PATCH] git-fetch.sh printed protocol fix","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-25T18:52:09Z","receivedAt":"2006-10-25T18:52:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Tuncer Ayaz\" <tuncer.ayaz@gmail.com> writes:\n\n> As a feature I wished for (ftp:// support in git-fetch) was added in 1.4.3\n> I tested that feature and found a minor logging issue. The mini-patch\n> below fixes that.  AFAIK the pattern expansion feature I've used should\n> be available in any current /bin/sh. If not we will have to find another\n> way to print the protocol part of the used fetch URL.\n\nYes, we also have supported https:// that way for a long time.\n\n> --- git-core-1.4.3.2/git-fetch.sh\t2006-10-24 07:29:47.000000000 +0200\n> +++ git-core-1.4.3.2.tma/git-fetch.sh\t2006-10-25 11:44:34.000000000 +0200\n> @@ -310,7 +310,7 @@\n> \t  done\n>  \t  expr \"z$head\" : \"z$_x40\\$\" >/dev/null ||\n> \t      die \"Failed to fetch $remote_name from $remote\"\n> -\t  echo >&2 Fetching \"$remote_name from $remote\" using http\n> +\t  echo >&2 Fetching \"$remote_name from $remote\" using ${remote%%:*}\n> \t  git-http-fetch -v -a \"$head\" \"$remote/\" || exit\n> \t  ;;\n>       rsync://*)\n\nAs you noticed, we stayed away from using ${parameter#word} or\n${parameter%word} substitutions so far, to be as compatible with\nvanilla shells as possible (I know even dash which is pretty\nmuch the most minimal supports it -- the syntax is in POSIX).  I\nam a bit reluctant to take this implementation right now.  We\ntend to use colon-form of \"expr\" for things like this.\n\nIt might make sense to do a survey of userbase at some point to\nsee if everybody's shell that works with the current set of\nscripts understands the substring substitution, and after\nfinding it out switch many invocations of expr to substring\nsubstitutions.\n\nFor now I'd take the patch but change it to match others to use\nexpr.\n\nNext time around, please sign your patch.\n\n-- >8 -- \nFrom: Tuncer Ayaz <tuncer.ayaz@gmail.com>\nDate: Wed, 25 Oct 2006 12:03:06 +0200\nSubject: [PATCH] git-fetch.sh printed protocol fix\n\nWe have supported https:// protocol for some time and in 1.4.3\nadded ftp:// protocol.  The transfer were still reported to be\nover http.\n\n[jc: Tuncer used substring parameter substitution ${remote%%:*}\n but I am deferring it to a later day.  We should replace\n colon-expr with substring substitution after everybody's shell\n can grok it someday, but we are not in a hurry. ]\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n git-fetch.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\nindex 79222fb..9eedf8b 100755\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -287,6 +287,7 @@ fetch_main () {\n       # There are transports that can fetch only one head at a time...\n       case \"$remote\" in\n       http://* | https://* | ftp://*)\n+\t  proto=`expr \"$remote\" : '\\([^:]*\\):'`\n \t  if [ -n \"$GIT_SSL_NO_VERIFY\" ]; then\n \t      curl_extra_args=\"-k\"\n \t  fi\n@@ -310,7 +311,7 @@ fetch_main () {\n \t  done\n \t  expr \"z$head\" : \"z$_x40\\$\" >/dev/null ||\n \t      die \"Failed to fetch $remote_name from $remote\"\n-\t  echo >&2 Fetching \"$remote_name from $remote\" using http\n+\t  echo >&2 \"Fetching $remote_name from $remote using $proto\"\n \t  git-http-fetch -v -a \"$head\" \"$remote/\" || exit\n \t  ;;\n       rsync://*)\n-- \n1.4.3.2.gc1a4\n\n"}]}