Re: [PATCH 2/6] remote.c: drop "remote" pointer from "struct branch"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 31, 2015, 22:29 UTC
- Message-ID
- <xmqq384kpzqb.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150331222431.GB31948@peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> On Tue, Mar 31, 2015 at 01:50:05PM -0700, Junio C Hamano wrote: > >> it first looked somewhat unnatural that you kept the name with which >> you need to trigger a search for the structure, instead of keeping >> the structure, one of whose field is its name already. > ... > That is the reason I was trying to explain above. Though I suppose you > could argue that remote_name suffers the same question (i.e., would we > ever set it to "origin"?)
Well, another would be that by keeping remote_name and making remote on-demand, we may still have to keep all the defined branches in core but we do not have to instanciate all the remotes, if each branch only knows the remote_name. A single look-up may be cheap but that is not a good reason to do one-per-each-branch if we do not need to.
> It is much worse for pushremotes, which can come from > branch.*.pushremote, remote.pushdefault, branch.*.remote, or "origin". > > I'll try to re-word the commit message.
Thanks.