Re: [PATCH] Allow update hooks to update refs on their own
- From
Jeff King <peff@peff.net>
- Date
- Nov 28, 2007, 20:22 UTC
- Message-ID
- <20071128202250.GA12777@coredump.intra.peff.net>
- In-Reply-To
- <C1321BD5-8F6B-47F9-9BDB-C2BF819D6F17@midwinter.com>
On Wed, Nov 28, 2007 at 12:16:27PM -0800, Steven Grimm wrote:
> Well, actually, I would still like opinions on one thing: What do people > think of having git-push do a fetch if the remote side changes a ref to > point to a revision that doesn't exist locally? Is there a situation where > you'd ever want to *not* do that?
It can be slow, since you have to make another connection to the server, so clearly it should only be done when you detect an update (which I think is what you're proposing).
A raw "git-fetch" might pull a lot of extra cruft that you didn't want to get right now. So if you did do it, I think it would make sense to construct a set of refspecs that match only the ones which need pulling (i.e., in update_tracking_ref, rather than doing the update, construct a refspec of "local:tracking", and then hand all such refspecs to git-fetch).
-Peff