{"thread":{"id":"55619","subject":"[PATCH] t5601: mark protocol v2-only test","startedAt":"2021-05-04T22:34:59Z","lastAt":"2021-05-05T01:12:12Z","messageCount":2,"participants":["Jonathan Tan","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"423620","messageId":"20210504223455.92823-1-jonathantanmy@google.com","threadId":"55619","inReplyTo":null,"subject":"[PATCH] t5601: mark protocol v2-only test","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2021-05-04T22:34:55Z","receivedAt":"2021-05-04T22:34:59Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"A HTTP-clone test introduced in 4fe788b1b0 (\"builtin/clone.c: add\n--reject-shallow option\", 2021-04-01) only works in protocol v2, but is\nnot marked as such.\n\nThe aforementioned patch implements --reject-shallow for a variety of\nsituations, but usage of a protocol that requires a remote helper is not\none of them. (Such an implementation would require extending the remote\nhelper protocol to support the passing of a \"reject shallow\" option, and\nthen teaching it to both protocol-speaking ends.)\n\nFor now, to make it pass when GIT_TEST_PROTOCOL_VERSION=0 is passed, add\n\"-c protocol.version=2\". A more complete solution would be either to\naugment the remote helper protocol to support this feature or to return\na fatal error when using --reject-shallow with a protocol that uses a\nremote helper.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\n---\nI think the remote helper solution can be done by adding an \"option\"\n(something that can be passed using the \"option\" command). We have\noptions for things like \"from-promisor\", for example. I haven't looked\ninto this in detail, though.\n---\n t/t5601-clone.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 329ae599fd..c0688467e7 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -762,7 +762,7 @@ test_expect_success 'partial clone using HTTP' '\n test_expect_success 'reject cloning shallow repository using HTTP' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit clone --bare --no-local --depth=1 src \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n-\ttest_must_fail git clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&\n+\ttest_must_fail git -c protocol.version=2 clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&\n \ttest_i18ngrep -e \"source repository is shallow, reject to clone.\" err &&\n \n \tgit clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo\n-- \n2.31.1.527.g47e6f16901-goog\n\n"},{"id":"423631","messageId":"xmqq8s4u56hj.fsf@gitster.g","threadId":"55619","inReplyTo":"20210504223455.92823-1-jonathantanmy@google.com","subject":"Re: [PATCH] t5601: mark protocol v2-only test","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-05T01:12:08Z","receivedAt":"2021-05-05T01:12:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Tan <jonathantanmy@google.com> writes:\n\n> A HTTP-clone test introduced in 4fe788b1b0 (\"builtin/clone.c: add\n> --reject-shallow option\", 2021-04-01) only works in protocol v2, but is\n> not marked as such.\n>\n> The aforementioned patch implements --reject-shallow for a variety of\n> situations, but usage of a protocol that requires a remote helper is not\n> one of them. (Such an implementation would require extending the remote\n> helper protocol to support the passing of a \"reject shallow\" option, and\n> then teaching it to both protocol-speaking ends.)\n>\n> For now, to make it pass when GIT_TEST_PROTOCOL_VERSION=0 is passed, add\n> \"-c protocol.version=2\". A more complete solution would be either to\n> augment the remote helper protocol to support this feature or to return\n> a fatal error when using --reject-shallow with a protocol that uses a\n> remote helper.\n>\n> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>\n> ---\n> I think the remote helper solution can be done by adding an \"option\"\n> (something that can be passed using the \"option\" command). We have\n> options for things like \"from-promisor\", for example. I haven't looked\n> into this in detail, though.\n\nSounds like a good direction to go in.  In the meantime, certainly\nthis will work around the issue in the original test.\n\nWill queue---thanks.\n\n\n>  t/t5601-clone.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\n> index 329ae599fd..c0688467e7 100755\n> --- a/t/t5601-clone.sh\n> +++ b/t/t5601-clone.sh\n> @@ -762,7 +762,7 @@ test_expect_success 'partial clone using HTTP' '\n>  test_expect_success 'reject cloning shallow repository using HTTP' '\n>  \ttest_when_finished \"rm -rf repo\" &&\n>  \tgit clone --bare --no-local --depth=1 src \"$HTTPD_DOCUMENT_ROOT_PATH/repo.git\" &&\n> -\ttest_must_fail git clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&\n> +\ttest_must_fail git -c protocol.version=2 clone --reject-shallow $HTTPD_URL/smart/repo.git repo 2>err &&\n>  \ttest_i18ngrep -e \"source repository is shallow, reject to clone.\" err &&\n>  \n>  \tgit clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo\n"}]}