Re: [PATCH v5 4/6] serve: advertise object-info feature
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 29, 2022, 17:57 UTC
- Message-ID
- <xmqqk07v7qe4.fsf@gitster.g>
- In-Reply-To
- <20220728230210.2952731-5-calvinwan@google.com>
Calvin Wan <calvinwan@google.com> writes:
> In order for a client to know what object-info components a server can > provide, advertise supported object-info features. This will allow a > client to decide whether to query the server for object-info or fetch as > a fallback.
OK. Now we will no longer advertise a bare "object-info", but "object-info=size" (and possibly in the future things other than "size"). How would this change affect older clients who knows what to do with "object-info" but not "object-info=<values>" yet?
Show 45 quoted lines
> +static int object_info_advertise(struct repository *r,
> + struct strbuf *value)
> +{
> + if (value)
> + strbuf_addstr(value, "size");
> + return 1;
> +}
> +
> static void session_id_receive(struct repository *r,
> const char *client_sid)
> {
> @@ -132,7 +140,7 @@ static struct protocol_capability capabilities[] = {
> },
> {
> .name = "object-info",
> - .advertise = always_advertise,
> + .advertise = object_info_advertise,
> .command = cap_object_info,
> },
> };
> diff --git a/t/t5555-http-smart-common.sh b/t/t5555-http-smart-common.sh
> index b1cfe8b7db..5a16d4259a 100755
> --- a/t/t5555-http-smart-common.sh
> +++ b/t/t5555-http-smart-common.sh
> @@ -131,7 +131,7 @@ test_expect_success 'git upload-pack --advertise-refs: v2' '
> fetch=shallow wait-for-done
> server-option
> object-format=$(test_oid algo)
> - object-info
> + object-info=size
> 0000
> EOF
>
> diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
> index 1896f671cb..ebb32644e3 100755
> --- a/t/t5701-git-serve.sh
> +++ b/t/t5701-git-serve.sh
> @@ -20,7 +20,7 @@ test_expect_success 'test capability advertisement' '
> fetch=shallow wait-for-done
> server-option
> object-format=$(test_oid algo)
> - object-info
> + object-info=size
> 0000
> EOF