Re: [PATCH v2 2/2] fetch: send "refs/tags/" prefix upon CLI refspecs
From: Jonathan Tan <hidden>
Date: 2018-06-18 23:16:48
Jonathan Tan [off-list ref] writes:quoted
quoted
Wouldn't that allow us not having to advertise the whole tags namespace only to implement the tag following?Yes, it would, but as far as I can tell, it would add an extra burden on the server to walk all refs requested in the ls-refs call (in order to determine which tags to send back in the response). Also, this walk must be done before any negotiation (since this is a ls-refs call),...My comment was that I doubt the "must be done" part of the above. How would refs-in-want be responded where client-supplied "I want 'master' branch---I am not asking for the exact object the first server I contacted said where the 'master' is at" gets turned into "So the final value of 'master' among these servers that are not quite in sync is this" by the one that gives you the pack, not necessarily the one that responds to ls-refs upon initial contact? Can't we do something similar, i.e. let the client say "I want tags that refer to new objects you are going to send me, I do not know what they are offhand" and the server that actually gives you the pack to say "here are the tags I ended up including"? The "include-tag" process to generate pack with extra objects (i.e. the tags that point at packed objects) has to involve walking for reachabliity anyway, so as long as the feature is supported, somebody has to do the work, and if you want to cut down the transfer cost of the refs/tags/* enumeration, it needs to happen on the server end, no?
Ah, I think I see. There are these possible worlds:
(1) the current world
(2) no ref-in-want, and upload-pack sends tag information as part of
its response to ls-refs
(3) no ref-in-want, but upload-pack can send ref information right
before the packfile
(4) ref-in-want, and upload-pack will send ref information right before
the packfile
I was only thinking about (2) and (4), but I think you are talking about
(3). Yes, that would work, although I don't think it's worth the
protocol churn to do (3) then (4), especially since we already have
ref-in-want patches sent to the mailing list - but I should have
discussed this option in my previous e-mails too.
Or perhaps v2 fetch should implement the automated tag following without using include-tag and instead as an extended feature of ref-in-want. I think that is merely giving a different name to the same idea outlined above, though ;-)
Instead of not using include-tag, I would define include-tag in the presence of want-refs to also include the refs, but I agree with this solution.