Re: [PATCH 0/3] Eliminate one user of extra_refs
- From
Jeff King <peff@peff.net>
- Date
- Jan 6, 2012, 14:53 UTC
- Message-ID
- <20120106145356.GB4525@sigill.intra.peff.net>
- In-Reply-To
- <1325859153-31016-1-git-send-email-mhagger@alum.mit.edu>
On Fri, Jan 06, 2012 at 03:12:30PM +0100, mhagger@alum.mit.edu wrote:
Show 10 quoted lines
> Receive pack currently uses "extra refs" to keep track of ".have" > references, which in turn are used to tell the source the SHA1s of > references that are already known to the repository via alternates. > > But the code already creates an array holding the alternate SHA1s. So > just read the SHA1s out of this array rather then round-tripping them > through the extra_refs mechanism. > > This is one step towards hopefully abolishing extra_refs altogether. > I still have to examine the other user.
Thanks, this is a nice simplification. The patches look good to me, and they produce the same output for a simple test (I happened to be fiddling with receive-pack and alternates yesterday, so I had a nice test case right at hand :) ).
> receive-pack: move more work into write_head_info()
BTW, I have a patch to make sending ".have" refs configurable[1] (it adds a receive.advertiseAlternates config variable), which this patch conflicts with. I don't think that is your problem, but I thought I would mention it since you are working in the area. Is that something we want in git?
-Peff
[1] We are using it at GitHub because our alternates repos are so huge
that the overhead of advertising the refs outweighs the minor
benefits you get from avoiding object transfer.