Subject: Re: [PATCH v6 0/6] cat-file: add remote-object-info to batch-command

From: Junio C Hamano <[email-masked]>
Date: Tue, 19 Nov 2024 09:16:50 +0900

Peijian Ju <[email-masked]> writes:

> While the “fetch and locally inspect” approach is an option, it would
> undermines the purpose of the feature, as highlighted by Christian’s
> partial clone and sparse checkout example. This feature is
> specifically designed to provide information without requiring the
> objects to be fetched, making such an alternative counterproductive.

Thanks, then wouldn't it make more sense to say, because support for
new protocol capabilities on the server side would have to happen at
a lot fewer places than the clients, we only work when the necessary
protocol extension support is available, without any "fetch and
locally inspect" fallback?

The above is after reading your "cons" here of the fallback.

> Cons:
> - Implementing a quarantine mechanism seems like a separate feature.
> This patch series already introduces a number of changes, and
> including the quarantine mechanism might make it too extensive.

Not an excuse to introduce incomplete changes that are not
sufficient to be useful, though.

> - Based on Mr. Patrick Steinhardt’s comment at [1], since
> remote-object-info operates only on protocol v2, adding a quarantine
> mechanism may lead to differing client-side behavior depending on the
> protocol, which could complicate the feature’s consistency.

Not doing quarantine would give even _more_ different client-side
behaviour, though.  When talking with a server with v2, you'll not
see a cruft object left locally, but with older servers, you'll see
crufts left behind.  After a failed remote-object-info call, you can
do an object-info to figure out what you needed to learn about the
object, but only after the failed remote-object-info was against an
older server.

So, I do not see it as a reason against putting temporary objects
into quarantine.

Not that I consider it important to give the same client-side
behaviour when talking with older and newer servers, though.  It is
natural for a new feature to be available only with versions of Git
that supports the feature, after all.

And if we throw that away as a goal, it starts to make more sense
not to add "fetch and locally inspect" anywhere.