Re: [PATCH GSoC v14 09/13] serve: advertise object-info feature
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jun 26, 2026, 22:23 UTC
- Message-ID
- <CAOLa=ZShTcHOekT+NuxMwZz-7P5i9aSWXSL6MW9_9aKkNwqsig@mail.gmail.com>
- In-Reply-To
- <20260625-ps-eric-work-rebase-v14-9-09f7ffe21a53@gmail.com>
Pablo Sabater <pabloosabaterr@gmail.com> writes:
Show 36 quoted lines
> From: Calvin Wan <calvinwan@google.com>
>
> 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.
>
> Helped-by: Jonathan Tan <jonathantanmy@google.com>
> Helped-by: Christian Couder <chriscool@tuxfamily.org>
> Signed-off-by: Calvin Wan <calvinwan@google.com>
> Signed-off-by: Eric Ju <eric.peijian@gmail.com>
> Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
> ---
> serve.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/serve.c b/serve.c
> index 49a6e39b1d..2b07d922b3 100644
> --- a/serve.c
> +++ b/serve.c
> @@ -89,7 +89,7 @@ static void session_id_receive(struct repository *r UNUSED,
> trace2_data_string("transfer", NULL, "client-sid", client_sid);
> }
>
> -static int object_info_advertise(struct repository *r, struct strbuf *value UNUSED)
> +static int object_info_advertise(struct repository *r, struct strbuf *value)
> {
> if (advertise_object_info == -1 &&
> repo_config_get_bool(r, "transfer.advertiseobjectinfo",
> @@ -97,6 +97,9 @@ static int object_info_advertise(struct repository *r, struct strbuf *value UNUS
> /* disabled by default */
> advertise_object_info = 0;
> }
> + /* Currently only size is supported */
> + if (value && advertise_object_info)
> + strbuf_addstr(value, "size");So is the plan that further options will be added here to value? If so, whats the format we will follow?
Show 6 quoted lines
> return advertise_object_info; > } > > > -- > 2.54.0