Re: [PATCH RFC 3/5] fetch-object-info: return a status instead of dying
- From
Pablo Sabater <pabloosabaterr@gmail.com>
- Date
- Sep 30, 2026, 18:03 UTC
- Message-ID
- <DLSUKMRZHHGO.HVX98MB8KLSF@gmail.com>
- In-Reply-To
- <xmqqwls2brca.fsf@gitster.g>
On Wed Sep 30, 2026 at 6:07 PM WEST, Junio C Hamano wrote:
Show 20 quoted lines
> Pablo Sabater <pabloosabaterr@gmail.com> writes: > >> A subsequent commit needs fetch_object_info() not to die() when the >> object-info capability is not enabled on the server, so that it can >> fall back. >> >> Make fetch_object_info() return FETCH_OBJECT_INFO_NOT_ENABLED instead >> of die()'ing when the server does not advertise the object-info >> capability, and propagate the status through the transport layer so >> that callers of transport_fetch_object_info() can act on it. It is now >> up to them whether to die() or fall back. > > It may be just me but unless the client can tell between the server > not supporting (i.e., they are unable to enable it even if they > wanted to) and not enabling (i.e., they are capable, but are not > willing to give it to you), it may make sense to report it as "not > available". "not enabled" sounds as if we know that it is the > latter and not the former. > > The code change looks very cleanly done.
Makes sense, I'll rename it to FETCH_OBJECT_INFO_NOT_AVAILABLE. The git cat-file remote-object-info command path die()'d with this message:
die(_("object-info capability is not enabled on the server"));I'll update the die() message as well.
Thanks.