git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “for-each-ref --format='%(symref) %(symref:short) %(flag)'”
  1. 0/4 for-each-ref --format='%(symref) %(symref:short) %(flag)'Junio C Hamano, Feb 13, 2010
  2. 1/4 builtin-for-each-ref.c: comment fixesJunio C Hamano, Feb 13, 2010
  3. 2/4 builtin-for-each-ref.c: check if we need to peel onion while parsing the formatJunio C Hamano, Feb 13, 2010
  4. 3/4 for-each-ref --format='%(symref) %(symref:short)'Junio C Hamano, Feb 13, 2010
  5. Jeff KingFeb 14, 2010
  6. Junio C HamanoFeb 14, 2010
  7. Jeff KingFeb 15, 2010
  8. 4/4 for-each-ref --format='%(flag)'Junio C Hamano, Feb 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.