{"thread":{"id":"35383","subject":"[PATCH v6 06/10] t5500: Test case for diag-url","startedAt":"2013-11-21T20:40:58Z","lastAt":"2013-11-21T23:27:23Z","messageCount":2,"participants":["Torsten Bögershausen","Junio C Hamano"],"isPatch":true,"patchVersion":6,"patchTotal":10},"messages":[{"id":"230908","messageId":"201311212140.58804.tboegi@web.de","threadId":"35383","inReplyTo":null,"subject":"[PATCH v6 06/10] t5500: Test case for diag-url","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-11-21T20:40:58Z","receivedAt":"2013-11-21T20:40:58Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"Add test cases using git fetch-pack --diag-url:\n\n- parse out host and path for URLs with a scheme (git:// file:// ssh://)\n- parse host names embedded by [] correctly\n- extract the port number, if present\n- seperate URLs like \"file\" (which are local)\n  from URLs like \"host:repo\" which should use ssh\n---\n t/t5500-fetch-pack.sh | 72 +++++++++++++++++++++++++++++++++++++++------------\n 1 file changed, 56 insertions(+), 16 deletions(-)\n\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 9136f2a..7f55b95 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -533,7 +533,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '\n '\n check_prot_path() {\n \t> actual &&\n-\t(git fetch-pack --diag-url \"$1\" 2>&1 1>stdout) | grep -v host= >actual &&\n+\t(git fetch-pack --diag-url  \"$1\" 2>&1 1>stdout) | grep -v host= >actual &&\n \techo \"Diag: url=$1\" >expected &&\n \techo \"Diag: protocol=$2\" >>expected &&\n \techo \"Diag: path=$3\" >>expected &&\n@@ -542,7 +542,7 @@ check_prot_path() {\n \n check_prot_host_path() {\n \t> actual &&\n-\tgit fetch-pack --diag-url \"$1\" 2>actual &&\n+\tgit fetch-pack --diag-url  \"$1\" 2>actual &&\n \techo \"Diag: url=$1\" >expected &&\n \techo \"Diag: protocol=$2\" >>expected &&\n \techo \"Diag: host=$3\" >>expected &&\n@@ -564,29 +564,69 @@ do\n \t\t\t\thh=$h\n \t\t\t\tpp=$p\n \t\t\tfi\n-\t\t\ttest_expect_success \"fetch-pack $p://$h/$r\" '\n+\t\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/$r\" '\n \t\t\t\tcheck_prot_host_path $p://$h/$r $pp \"$hh\" \"/$r\"\n \t\t\t'\n-\t\t\t# \"/~\" -> \"~\" conversion for git\n-\t\t\ttest_expect_success \"fetch-pack $p://$h/~$r\" '\n+\t\t\t# \"/~\" -> \"~\" conversion\n+\t\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/~$r\" '\n \t\t\t\tcheck_prot_host_path $p://$h/~$r $pp \"$hh\" \"~$r\"\n \t\t\t'\n \t\tdone\n \tdone\n+\tp=file\n \t# file with scheme\n-\tfor p in file\n+\tfor h in \"\" host host:12 [::1] [::1]:23\n \tdo\n-\t\tfor h in \"\" host host:12 [::1] [::1]:23\n-\t\tdo\n-\t\t\ttest_expect_success \"fetch-pack $p://$h/$r\" '\n-\t\t\t\tcheck_prot_path $p://$h/$r $p \"/$r\"\n-\t\t\t'\n-\t\t\t# No \"/~\" -> \"~\" conversion for file\n-\t\t\ttest_expect_success \"fetch-pack $p://$h/~$r\" '\n-\t\t\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n-\t\t\t'\n-\t\tdone\n+\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/$r\" '\n+\t\t\tcheck_prot_path $p://$h/$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\t\tcheck_prot_path $p://$h/~$r $p \"/~$r\"\n+\t\t'\n+\tdone\n+\t# file without scheme\n+\tfor h in nohost nohost:12 [::1] [::1]:23 [ [:aa\n+\tdo\n+\t\ttest_expect_success \"fetch-pack --diag-url ./$h:$r\" '\n+\t\t\tcheck_prot_path ./$h:$r $p \"./$h:$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\tcheck_prot_path ./$p:$h/~$r $p \"./$p:$h/~$r\"\n+\t\t'\n+\tdone\n+\t#ssh without scheme\n+\tp=ssh\n+\tfor h in host [::1]\n+\tdo\n+\t\thh=$(echo $h | tr -d \"[]\")\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 \tdone\n+\th=host\n+\thh=host\n+\t# \"/~\" -> \"~\" conversion\n+\ttest_expect_failure \"fetch-pack --diag-url $h:/~$r\" '\n+\t\tcheck_prot_host_path $h:/~$r $p \"$hh\" \"~$r\"\n+\t'\n+\th=[::1]\n+\thh=$(echo $h | tr -d \"[]\")\n+\t# \"/~\" -> \"~\" conversion\n+\ttest_expect_success \"fetch-pack --diag-url $h:/~$r\" '\n+\t\tcheck_prot_host_path $h:/~$r $p \"$hh\" \"~$r\"\n+\t'\n done\n \n+test_expect_success MINGW 'fetch-pack --diag-url file://c:/repo' '\n+\tcheck_prot_path file://c:/repo file c:/repo\n+'\n+test_expect_success MINGW 'fetch-pack --diag-url file:///c:/repo' '\n+\tcheck_prot_path file://c:/repo file c:/repo\n+'\n+test_expect_success MINGW 'fetch-pack --diag-url c:repo' '\n+\tcheck_prot_path c:repo file c:repo\n+'\n+\n test_done\n-- \n1.8.4.457.g424cb08\n"},{"id":"230923","messageId":"xmqqfvqp2v50.fsf@gitster.dls.corp.google.com","threadId":"35383","inReplyTo":"201311212140.58804.tboegi@web.de","subject":"Re: [PATCH v6 06/10] t5500: Test case for diag-url","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-11-21T23:27:23Z","receivedAt":"2013-11-21T23:27:23Z","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> Add test cases using git fetch-pack --diag-url:\n>\n> - parse out host and path for URLs with a scheme (git:// file:// ssh://)\n> - parse host names embedded by [] correctly\n> - extract the port number, if present\n> - seperate URLs like \"file\" (which are local)\n>   from URLs like \"host:repo\" which should use ssh\n> ---\n>  t/t5500-fetch-pack.sh | 72 +++++++++++++++++++++++++++++++++++++++------------\n>  1 file changed, 56 insertions(+), 16 deletions(-)\n>\n> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\n> index 9136f2a..7f55b95 100755\n> --- a/t/t5500-fetch-pack.sh\n> +++ b/t/t5500-fetch-pack.sh\n> @@ -533,7 +533,7 @@ test_expect_success 'shallow fetch with tags does not break the repository' '\n>  '\n>  check_prot_path() {\n>  \t> actual &&\n> -\t(git fetch-pack --diag-url \"$1\" 2>&1 1>stdout) | grep -v host= >actual &&\n> +\t(git fetch-pack --diag-url  \"$1\" 2>&1 1>stdout) | grep -v host= >actual &&\n\nWhat is this change about???\n\n>  \techo \"Diag: url=$1\" >expected &&\n>  \techo \"Diag: protocol=$2\" >>expected &&\n>  \techo \"Diag: path=$3\" >>expected &&\n> @@ -542,7 +542,7 @@ check_prot_path() {\n>  \n>  check_prot_host_path() {\n>  \t> actual &&\n> -\tgit fetch-pack --diag-url \"$1\" 2>actual &&\n> +\tgit fetch-pack --diag-url  \"$1\" 2>actual &&\n\nLikewise...\n\n> @@ -564,29 +564,69 @@ do\n>  \t\t\t\thh=$h\n>  \t\t\t\tpp=$p\n>  \t\t\tfi\n> -\t\t\ttest_expect_success \"fetch-pack $p://$h/$r\" '\n> +\t\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/$r\" '\n>  \t\t\t\tcheck_prot_host_path $p://$h/$r $pp \"$hh\" \"/$r\"\n>  \t\t\t'\n> -\t\t\t# \"/~\" -> \"~\" conversion for git\n> -\t\t\ttest_expect_success \"fetch-pack $p://$h/~$r\" '\n> +\t\t\t# \"/~\" -> \"~\" conversion\n> +\t\t\ttest_expect_success \"fetch-pack --diag-url $p://$h/~$r\" '\n\nIs this part, especially the \"s/ for git//\" bit, an \"oops, the\nearlier one was wrong\" fix to [05/10]?  If so, please don't.\nInstead, please get it right in that patch before sending the series\nout.\n"}]}