{"thread":{"id":"35388","subject":"[PATCH v6 10/10] git fetch: support host:/~repo","startedAt":"2013-11-21T20:42:10Z","lastAt":"2013-11-21T23:40:26Z","messageCount":2,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":6,"patchTotal":10},"messages":[{"id":"230913","messageId":"201311212142.11216.tboegi@web.de","threadId":"35388","inReplyTo":null,"subject":"[PATCH v6 10/10] git fetch: support host:/~repo","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-11-21T20:42:10Z","receivedAt":"2013-11-21T20:42:10Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Since commit faea9ccb URLs host:~repo or ssh://host:/~repo\nreach the home directory.\nIn 356bece0 support for [] was introduced, and as a side\neffect, [host]:/~repo was the same as [host]:~repo.\nThe side effect was removed in c01049ae, \"connect.c: Corner case for IPv6\".\n\nRe-reading the documentation (in urls.txt) we find that\n\"ssh://host:/~repo\",\n\"host:/~repo\" or\n\"host:~repo\"\nspecifiy the repository \"repo\" in the home directory at \"host\".\n\nSo make the handling of \"host:/~repo\" (or \"[host]:/~repo\") a feature,\nand revert the possible regression introduced in c01049ae.\n---\n connect.c             |  3 +--\n t/t5500-fetch-pack.sh |  4 ++--\n t/t5601-clone.sh      | 12 ++++++++++--\n 3 files changed, 13 insertions(+), 6 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex 95568ac..2cad296 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -625,8 +625,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,\n \tend = path; /* Need to \\0 terminate host here */\n \tif (separator == ':')\n \t\tpath++; /* path starts after ':' */\n-\tif ((protocol == PROTO_GIT) ||\n-\t\t\t(protocol == PROTO_SSH && separator == '/')) {\n+\tif (protocol == PROTO_GIT || protocol == PROTO_SSH) {\n \t\tif (path[1] == '~')\n \t\t\tpath++;\n \t}\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 69a2110..7d9f18c 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -601,9 +601,9 @@ do\n \t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n \t\t\tcheck_prot_path $h:$r $p \"$r\"\n \t\t'\n-\t\t# No \"/~\" -> \"~\" conversion\n+\t\t# Do the \"/~\" -> \"~\" conversion\n \t\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n-\t\t\tcheck_prot_host_path $h:/~$r $p \"$h\" \"/~$r\"\n+\t\t\tcheck_prot_host_path $h:/~$r $p \"$h\" \"~$r\"\n \t\t'\n \tdone\n done\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex bd1bfd3..62fbd7e 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -348,7 +348,7 @@ test_expect_success MINGW 'clone c:temp is dos drive' '\n '\n \n #ip v4\n-for repo in rep rep/home/project /~proj 123\n+for repo in rep rep/home/project 123\n do\n \ttest_expect_success \"clone host:$repo\" '\n \t\ttest_clone_url host:$repo host $repo\n@@ -356,12 +356,20 @@ do\n done\n \n #ipv6\n-for repo in rep rep/home/project 123 /~proj\n+for repo in rep rep/home/project 123\n do\n \ttest_expect_success \"clone [::1]:$repo\" '\n \t\ttest_clone_url [::1]:$repo ::1 $repo\n \t'\n done\n+#home directory\n+test_expect_success \"clone host:/~repo\" '\n+\ttest_clone_url host:/~repo host \"~repo\"\n+'\n+\n+test_expect_success \"clone [::1]:/~repo\" '\n+\ttest_clone_url [::1]:/~repo ::1 \"~repo\"\n+'\n \n # Corner cases\n for url in foo/bar:baz [foo]bar/baz:qux [foo/bar]:baz\n-- \n1.8.4.457.g424cb08\n"},{"id":"230926","messageId":"xmqq38mp2uj9.fsf@gitster.dls.corp.google.com","threadId":"35388","inReplyTo":"201311212142.11216.tboegi@web.de","subject":"Re: [PATCH v6 10/10] git fetch: support host:/~repo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-11-21T23:40:26Z","receivedAt":"2013-11-21T23:40:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> Since commit faea9ccb URLs host:~repo or ssh://host:/~repo\n> reach the home directory.\n> In 356bece0 support for [] was introduced, and as a side\n> effect, [host]:/~repo was the same as [host]:~repo.\n> The side effect was removed in c01049ae, \"connect.c: Corner case for IPv6\".\n>\n> Re-reading the documentation (in urls.txt) we find that\n> \"ssh://host:/~repo\",\n> \"host:/~repo\" or\n> \"host:~repo\"\n> specifiy the repository \"repo\" in the home directory at \"host\".\n>\n> So make the handling of \"host:/~repo\" (or \"[host]:/~repo\") a feature,\n> and revert the possible regression introduced in c01049ae.\n\nIsn't c01049ae a private copy in your repository, a part of this\nseries?  Perhaps the series needs to be (re)structured to avoid\nintroducing a \"possible regression\" in the first place?\n\nConfused...\n\n> ---\n>  connect.c             |  3 +--\n>  t/t5500-fetch-pack.sh |  4 ++--\n>  t/t5601-clone.sh      | 12 ++++++++++--\n>  3 files changed, 13 insertions(+), 6 deletions(-)\n>\n> diff --git a/connect.c b/connect.c\n> index 95568ac..2cad296 100644\n> --- a/connect.c\n> +++ b/connect.c\n> @@ -625,8 +625,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,\n>  \tend = path; /* Need to \\0 terminate host here */\n>  \tif (separator == ':')\n>  \t\tpath++; /* path starts after ':' */\n> -\tif ((protocol == PROTO_GIT) ||\n> -\t\t\t(protocol == PROTO_SSH && separator == '/')) {\n> +\tif (protocol == PROTO_GIT || protocol == PROTO_SSH) {\n>  \t\tif (path[1] == '~')\n>  \t\t\tpath++;\n>  \t}\n> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\n> index 69a2110..7d9f18c 100755\n> --- a/t/t5500-fetch-pack.sh\n> +++ b/t/t5500-fetch-pack.sh\n> @@ -601,9 +601,9 @@ do\n>  \t\ttest_expect_success \"fetch-pack --diag-url $h:$r\" '\n>  \t\t\tcheck_prot_path $h:$r $p \"$r\"\n>  \t\t'\n> -\t\t# No \"/~\" -> \"~\" conversion\n> +\t\t# Do the \"/~\" -> \"~\" conversion\n>  \t\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n> -\t\t\tcheck_prot_host_path $h:/~$r $p \"$h\" \"/~$r\"\n> +\t\t\tcheck_prot_host_path $h:/~$r $p \"$h\" \"~$r\"\n>  \t\t'\n>  \tdone\n>  done\n> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\n> index bd1bfd3..62fbd7e 100755\n> --- a/t/t5601-clone.sh\n> +++ b/t/t5601-clone.sh\n> @@ -348,7 +348,7 @@ test_expect_success MINGW 'clone c:temp is dos drive' '\n>  '\n>  \n>  #ip v4\n> -for repo in rep rep/home/project /~proj 123\n> +for repo in rep rep/home/project 123\n>  do\n>  \ttest_expect_success \"clone host:$repo\" '\n>  \t\ttest_clone_url host:$repo host $repo\n> @@ -356,12 +356,20 @@ do\n>  done\n>  \n>  #ipv6\n> -for repo in rep rep/home/project 123 /~proj\n> +for repo in rep rep/home/project 123\n>  do\n>  \ttest_expect_success \"clone [::1]:$repo\" '\n>  \t\ttest_clone_url [::1]:$repo ::1 $repo\n>  \t'\n>  done\n> +#home directory\n> +test_expect_success \"clone host:/~repo\" '\n> +\ttest_clone_url host:/~repo host \"~repo\"\n> +'\n> +\n> +test_expect_success \"clone [::1]:/~repo\" '\n> +\ttest_clone_url [::1]:/~repo ::1 \"~repo\"\n> +'\n>  \n>  # Corner cases\n>  for url in foo/bar:baz [foo]bar/baz:qux [foo/bar]:baz\n"}]}