Re: [PATCH RFC 1/3] cat-file: extract the transport ownership from get_remote_info()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 28, 2026, 06:37 UTC
- Message-ID
- <xmqqbj8ee3g1.fsf@gitster.g>
- In-Reply-To
- <DMFX8JPX16W8.9VBEJMQVF998@gmail.com>
"Pablo Sabater" <pabloosabaterr@gmail.com> writes:
Show 14 quoted lines
>>> + if (!transport->smart_options)
>>> + die(_("smart options required"));
>>
>> Is this an end-user facing error message? I am not sure a user who
>> saw this message can figure out what went wrong or how to correct
>> it.
>
> I thought it would be better to say why it fails instead of a generic
> error. If we drop the check it will die() later with "remote does not
> support object-info".
>
> Since the smart options check only die()s when the remote is a bundle,
> I could keep it and change the message to "object-info is not supported
> on bundles".I am somewhat torn on this. It is certainly much better than the "smart options required" message, which the end user would not know how to act upon. However, that improvement only holds until we gain another transport other than bundle that also lacks support for "smart options". Saying something like "object-info is not supported by this remote." would avoid blindly mentioning "bundle" when the remote that lacks object-info support is actually not a bundle, but it loses the clarity your rewritten message provides when the problematic remote indeed is a bundle.
Do we have the remote information at this point in the code (i.e., the URL of the remote that was given to the remote-object-info command) that the user would immediately recognize as the remote they asked the command to access? If so, "object-info is not supported by %s" filled with the remote information would probably work better.
Thanks.