From: Karthik Nayak Date: Wed, 29 Jul 2026 22:39:06 GMT Subject: Re: [PATCH GSoC 1/5] protocol-caps: add type support to object-info Message-ID: In-Reply-To: <20260725-objecttype-support-v1-1-2d4ca3bbabf1@gmail.com> Pablo Sabater writes: > Teach the server-side object-info handler to accept type as a requested > field. When the client includes type in its object-info request, the > server returns the requested object type. > > While at it, fix requested_info->size bit field style. > > Mentored-by: Karthik Nayak > Mentored-by: Chandra Pratap > Signed-off-by: Pablo Sabater > --- > protocol-caps.c | 21 ++++++++++++++++++--- > t/t5701-git-serve.sh | 27 +++++++++++++++++++++++++++ > 2 files changed, 45 insertions(+), 3 deletions(-) > > diff --git a/protocol-caps.c b/protocol-caps.c > index 02261be14d..5531d388f0 100644 > --- a/protocol-caps.c > +++ b/protocol-caps.c > @@ -11,7 +11,8 @@ > #include "strbuf.h" > > struct requested_info { > - unsigned size : 1; > + unsigned size:1; > + unsigned type:1; > }; > > /* > @@ -73,15 +74,20 @@ static void send_info(struct repository *r, struct packet_writer *writer, > if (info->size) > packet_writer_write(writer, "size"); > > + if (info->type) > + packet_writer_write(writer, "type"); > + > for_each_string_list_item (item, oid_str_list) { > const char *oid_str = item->string; > struct object_id oid; > size_t object_size; > + enum object_type object_type; > This is fine, but If you do reiterate, maybe we can follow the reverse christmas tree [1] format and move this field up? Or maybe its just me... > if (get_oid_hex_algop(oid_str, &oid, r->hash_algo) < 0) { > packet_writer_error( > writer, > - "object-info: protocol error, expected to get oid, not '%s'", > + "object-info: protocol error, expected to get " > + "oid, not '%s'", I know this is to fix styling, but we generally don't do such changes unless we're touching the code or around it. It just tends to be a distraction :) [snip] [1]: https://lwn.net/Articles/758613/