git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/4] for-each-ref --format='%(symref) %(symref:short)'
Date: Mon, 15 Feb 2010 03:39:24 -0500	[thread overview]
Message-ID: <20100215083924.GA13636@coredump.intra.peff.net> (raw)
In-Reply-To: <7vy6iwp0oy.fsf@alter.siamese.dyndns.org>

On Sun, Feb 14, 2010 at 02:32:29AM -0800, Junio C Hamano wrote:

> 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

  reply	other threads:[~2010-02-15  8:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13  5:55 [PATCH] git-for-each-ref: add new field name "symbolic" Larry D'Anna
2010-02-13  7:45 ` Junio C Hamano
2010-02-13  8:51   ` Jeff King
2010-02-13 20:30     ` [PATCH 0/4] for-each-ref --format='%(symref) %(symref:short) %(flag)' Junio C Hamano
2010-02-13 20:30       ` [PATCH 1/4] builtin-for-each-ref.c: comment fixes Junio C Hamano
2010-02-13 20:30       ` [PATCH 2/4] builtin-for-each-ref.c: check if we need to peel onion while parsing the format Junio C Hamano
2010-02-13 20:30       ` [PATCH 3/4] for-each-ref --format='%(symref) %(symref:short)' Junio C Hamano
2010-02-14  6:32         ` Jeff King
2010-02-14 10:32           ` Junio C Hamano
2010-02-15  8:39             ` Jeff King [this message]
2010-02-13 20:30       ` [PATCH 4/4] for-each-ref --format='%(flag)' Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100215083924.GA13636@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).