Re: [PATCH 3/4] for-each-ref --format='%(symref) %(symref:short)'
- From
Jeff King <peff@peff.net>
- Date
- Feb 15, 2010, 08:39 UTC
- Message-ID
- <20100215083924.GA13636@coredump.intra.peff.net>
- In-Reply-To
- <7vy6iwp0oy.fsf@alter.siamese.dyndns.org>
On Sun, Feb 14, 2010 at 02:32:29AM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes: > > > It feels ugly that we need to re-resolve the ref when we simply threw > > that information away earlier from when we called resolve_ref in > > get_ref_dir... > > It is true and I indeed thought about it while doing the patch, but "how > often would we see symref in the entire refs list, and what percentage of > callers would benefit from seeing this information?" stopped me from going > further in that direction.
It is really only two code-paths (the one I mentioned, and the new one you are adding). I was thinking that we had to pay the resolve_ref cost for _every_ ref, symref or not, but that is not the case. Because we pass along the flag, we can re-resolve only the few that need it.
So there is even less efficiency to be gained than I at first thought. Let's just drop it, as it is such an invasive change for no good reason.
-Peff