Subject: Re: [PATCH v2 3/3] upload-pack: allow configuring a missing-action

From: Junio C Hamano <[email-masked]>
Date: Fri, 24 May 2024 14:51:52 -0700

Christian Couder <[email-masked]> writes:

>> Repository S borrows from its "promisor" X, and repository C which
>> initially cloned from S borrows from its "promisor" S.  Even if C
>> wants an object in order to fill in the gap in its object graph, S
>> may not have it (and S itself may have no need for that object), and
>> in such a case, bypassing S and let C go directly to X would make
>> sense.
> ...
>>
>> It feels utterly irresponsible to give an option to set up a server
>> that essentially declares: I'll serve objects you ask me as best
>> efforts basis, the pack stream I'll give you may not have all
>> objects you asked for and missing some objects, and when I do so, I
>> am not telling you which objects I omitted.
>
> I don't think it's irresponsible. The client anyways checks that it
> got something usable in the same way as it does when it performs a
> partial fetch or clone. The fetch or clone fails if that's not the
> case. For example if the checkout part of a clone needs some objects
> but cannot get them, the whole clone fails.

But then what can the repository C do after seeing such a failure?

With the design, S does not even consult C to see if C knows about
X.  Without knowing that, it cannot safely decide that it does not
have to send objects that can be obtained from X to C.  Instead, S
simply say "if C requests an object that I do not have, just ignore
it and let C grab it from somewhere else".  How would it not be an
irresponsible design?