{"thread":{"id":"51721","subject":"[PATCH 0/1] mingw: support UNC as file://server/share/repo","startedAt":"2019-08-24T22:08:02Z","lastAt":"2019-08-26T17:06:58Z","messageCount":3,"participants":["Johannes Schindelin via GitGitGadget","Torsten Bögershausen via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"381073","messageId":"pull.93.git.gitgitgadget@gmail.com","threadId":"51721","inReplyTo":null,"subject":"[PATCH 0/1] mingw: support UNC as file://server/share/repo","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-08-24T22:07:58Z","receivedAt":"2019-08-24T22:08:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Windows users might think that the common file:/// protocol also works for\nnetwork shares. This patch makes it so.\n\nTorsten Bögershausen (1):\n  mingw: support UNC in git clone file://server/share/repo\n\n connect.c             |  4 ++++\n t/t5500-fetch-pack.sh | 13 +++++++++++--\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\n\nbase-commit: 5d826e972970a784bd7a7bdf587512510097b8c7\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-93%2Fdscho%2Ffile-url-to-unc-path-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-93/dscho/file-url-to-unc-path-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/93\n-- \ngitgitgadget\n"},{"id":"381074","messageId":"37957d08acfc053f2a13953f424b0a6b26b3c895.1566684478.git.gitgitgadget@gmail.com","threadId":"51721","inReplyTo":"pull.93.git.gitgitgadget@gmail.com","subject":"[PATCH 1/1] mingw: support UNC in git clone file://server/share/repo","fromName":"Torsten Bögershausen via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-08-24T22:07:59Z","receivedAt":"2019-08-24T22:08:03Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= <tboegi@web.de>\n\nExtend the parser to accept file://server/share/repo in the way that\nWindows users expect it to be parsed who are used to referring to file\nshares by UNC paths of the form \\\\server\\share\\folder.\n\n[jes: tightened check to avoid handling file://C:/some/path as a UNC\npath.]\n\nThis closes https://github.com/git-for-windows/git/issues/1264.\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n connect.c             |  4 ++++\n t/t5500-fetch-pack.sh | 13 +++++++++++--\n 2 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/connect.c b/connect.c\nindex 24281b6082..d72772a36d 100644\n--- a/connect.c\n+++ b/connect.c\n@@ -918,6 +918,10 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,\n \n \tif (protocol == PROTO_LOCAL)\n \t\tpath = end;\n+\telse if (protocol == PROTO_FILE && *host != '/' &&\n+\t\t !has_dos_drive_prefix(host) &&\n+\t\t offset_1st_component(host - 2) > 1)\n+\t\tpath = host - 2; /* include the leading \"//\" */\n \telse if (protocol == PROTO_FILE && has_dos_drive_prefix(end))\n \t\tpath = end; /* \"file://$(pwd)\" may be \"file://C:/projects/repo\" */\n \telse\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 086f2c40f6..f021db44b1 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -698,13 +698,22 @@ do\n \t# file with scheme\n \tfor p in file\n \tdo\n-\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n \t\t\tcheck_prot_path $p://$h/$r $p \"/$r\"\n \t\t'\n+\t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\t\tcheck_prot_path $p://$h/$r $p \"//$h/$r\"\n+\t\t'\n+\t\ttest_expect_success MINGW \"fetch-pack --diag-url $p:///$r\" '\n+\t\t\tcheck_prot_path $p:///$r $p \"/$r\"\n+\t\t'\n \t\t# No \"/~\" -> \"~\" conversion for file\n-\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/~$r\" '\n+\t\ttest_expect_success !MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n \t\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n \t\t'\n+\t\ttest_expect_success MINGW \"fetch-pack --diag-url $p://$h/~$r\" '\n+\t\t\tcheck_prot_path $p://$h/~$r $p \"//$h/~$r\"\n+\t\t'\n \tdone\n \t# file without scheme\n \tfor h in nohost nohost:12 [::1] [::1]:23 [ [:aa\n-- \ngitgitgadget\n"},{"id":"381214","messageId":"xmqq7e6zj1p2.fsf@gitster-ct.c.googlers.com","threadId":"51721","inReplyTo":"pull.93.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/1] mingw: support UNC as file://server/share/repo","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-08-26T17:06:49Z","receivedAt":"2019-08-26T17:06:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> Windows users might think that the common file:/// protocol also works for\n> network shares. This patch makes it so.\n\nThanks, both.\n\n>\n> Torsten Bögershausen (1):\n>   mingw: support UNC in git clone file://server/share/repo\n>\n>  connect.c             |  4 ++++\n>  t/t5500-fetch-pack.sh | 13 +++++++++++--\n>  2 files changed, 15 insertions(+), 2 deletions(-)\n>\n>\n> base-commit: 5d826e972970a784bd7a7bdf587512510097b8c7\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-93%2Fdscho%2Ffile-url-to-unc-path-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-93/dscho/file-url-to-unc-path-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/93\n"}]}