]> git.99rst.org Git - git.git/commit
transport: add client support for object-info
authorCalvin Wan <redacted>
Fri, 24 Jul 2026 10:54:22 +0000 (12:54 +0200)
committerJunio C Hamano <redacted>
Fri, 24 Jul 2026 15:46:59 +0000 (08:46 -0700)
commit12a19eec1d7c0121e0c82c95a2300fdbad1f18f2
treee11b5b9d5089f3b9b31be948cba2dc3c724bbaae
parent7dcbd35a120c04e30462407c4c9446aaaba9068f
transport: add client support for object-info

Sometimes, it is beneficial to retrieve information about an object
without downloading it entirely. The server-side logic for this
functionality was implemented in commit "a2ba162cda (object-info:
support for retrieving object info, 2021-04-20)." And the wire
format is documented at
https://git-scm.com/docs/protocol-v2#_object_info.

Introduce client-side support for the object-info capability.

Add its own function for object-info separate from existing fetch
infrastructure.

Currently, the client supports requesting a list of OIDs with the size
attribute from a v2 server. If the server does not advertise this
feature (i.e., transfer.advertiseobjectinfo is set to false), the client
returns an error and exits.

Note that:

1. The entire request is written into req_buf before being sent to the
   remote. This approach follows the pattern used in the
   send_fetch_request() logic within 'fetch-pack.c'. Streaming the
   request is not addressed in this patch.

2. A new field 'unrecognized' has been added to object_info. This new
   field is set at fetch_object_info() when the object is unrecognized
   by the server.

Helped-by: Jonathan Tan <redacted>
Helped-by: Christian Couder <redacted>
Signed-off-by: Calvin Wan <redacted>
Signed-off-by: Eric Ju <redacted>
Signed-off-by: Pablo Sabater <redacted>
Signed-off-by: Junio C Hamano <redacted>
Makefile
fetch-object-info.c [new file with mode: 0644]
fetch-object-info.h [new file with mode: 0644]
meson.build
odb.h
transport-helper.c
transport-internal.h
transport.c
transport.h
git clone https://git.99rst.org/PROJECT