On Tue, Aug 20, 2024 at 7:01 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > Christian Couder <christian.couder@xxxxxxxxx> writes: > > > I agree that it's more useful the other way though. That is for a > > server to know that the client has the capability but might not want > > to use it. > > > > For example, when C clones without using X directly, it can be a > > burden for S to have to fetch large objects from X (as it would use > > precious disk space on S, and unnecessarily duplicate large objects). > > So S might want to say "please use a newer or different client that > > has the 'promisor-remote' capability" if it knows that the client > > doesn't have this capability. If S knows that C has the capability but > > didn't configure it or doesn't want to use it, it could instead say > > something like "please consider activating the 'promisor-remote' > > capability by doing this and that to avoid burdening this server and > > get a faster clone". > > > > Note that the client might not be 'git'. It might be a "compatible" > > implementation (libgit2, gix, JGit, etc), so using the version passed > > in the "agent" protocol capability is not a good way to detect if the > > client has the capability or not. > > It is none of S's business to even know about C's "true" capability, > if C does not want to use it with S. I do not quite find the above > a credible justification. Ok, as you and others have said that the "promisor-remote" capability should not be advertised by the server or the client if they aren't actually using it, then I have changed the implementation in the version 2 of the patch series according to that. I still think that this change might make it harder than necessary (for example for support teams at GitHub and GitLab) to help users and debug issues related to this. The only downside I saw with always advertising the "promisor-remote" capability even when not using it, was that it added a bit of bloat in the protocol, but there are a number of things that could be done to avoid that. For example changing the name of the capability to just "promisor" or even "pr" instead of "promisor-remote" could reduce the size of the overhead. Thanks for the review.