Re: [PATCH GSoC RFC v12 12/12] cat-file: make remote-object-info allow-list dynamic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2026, 18:54 UTC
- Message-ID
- <xmqqfr2v1r4l.fsf@gitster.g>
- In-Reply-To
- <CA+J6zkQ22en2HgH03EedKOfC+jLcHH2UbwpH0h_bDEAHR6B2pg@mail.gmail.com>
Chandra Pratap <chandrapratap3519@gmail.com> writes:
Show 6 quoted lines
> On Mon, 8 Jun 2026 at 15:45, Pablo Sabater <pabloosabaterr@gmail.com> wrote: >> >> The static allow-list in expand_atom() is hardcoded to only allow >> "objectname" and "objectsize" for remote queries. This works because >> ... >> }
You just forced readers to skip over 200+ lines of quoted material, looking for something interesting you have said in response to comment on the patch in vain.
Show 18 quoted lines
>> diff --git a/fetch-object-info.c b/fetch-object-info.c
>> index 51a898430d..425929a269 100644
>> --- a/fetch-object-info.c
>> +++ b/fetch-object-info.c
>> @@ -39,6 +39,12 @@ int fetch_object_info(const enum protocol_version version, struct object_info_ar
>> case protocol_v2:
>> if (!server_supports_v2("object-info"))
>> die(_("object-info capability is not enabled on the server"));
>> +
>> + for (int i = args->object_info_options->nr - 1; i >= 0; i--)
>
> Isn't args->object_info_options->nr of type size_t? We should probably
> do something
> like:
>
> for (size_t i = 0; i < args->args->object_info_options->nr; i++)
>
> instead.This is a valid observation and a careful reading like this is very much appreciated. It is unfortunate that it was buried by 200+ lines of irrelevant material before we find it.
Thanks.
Show 15 quoted lines
>> + if (!server_supports_feature("object-info",
>> + args->object_info_options->items[i].string, 0))
>> + unsorted_string_list_delete_item(args->object_info_options, i, 0);
>> +
>> send_object_info_request(fd_out, args);
>> break;
>> case protocol_v1:
>>
>> --
>> 2.54.0
>
> Other than these, the patch series LGTM for now.
>
> Thanks,
> Chandra.