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

Re: [PATCH] fetch: do not redundantly calculate tag refmap

From
Jeff King <peff@peff.net>
Date
Nov 11, 2016, 02:09 UTC
Message-ID
<20161111020958.ozzbwrvmo5fdf3jj@sigill.intra.peff.net>
In-Reply-To
<1478823208-10647-1-git-send-email-jonathantanmy@google.com>
On Thu, Nov 10, 2016 at 04:13:28PM -0800, Jonathan Tan wrote:
Show 16 quoted lines
> builtin/fetch.c redundantly calculates refmaps for tags twice. Remove
> the first calculation.
> 
> This is only a code simplification and slight performance improvement -
> the result is unchanged, as the redundant refmaps are subsequently
> removed by the invocation to "ref_remove_duplicates" anyway.
> 
> This was introduced in commit c5a84e9 ("fetch --tags: fetch tags *in
> addition to* other stuff", 2013-10-29) when modifying the effect of the
> --tags parameter to "git fetch". The refmap-for-tag calculation was
> copied instead of moved.
> 
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> ---
> 
> (I noticed this when working on something in this file.)

Coincidentally I noticed this a few weeks ago, too, while working on [1], but didn't follow it up. Mainly I was worried there was something hidden or clever going on, but I think it really is just a case of the code growing the two calls over time. So this looks good to me. Thanks for digging it up.

-Peff
[1] http://public-inbox.org/git/20161024132932.i42rqn2vlpocqmkq@sigill.intra.peff.net/
Previous: Jonathan Tan
Message 2 of 2 in “fetch: do not redundantly calculate tag refmap”
  1. fetch: do not redundantly calculate tag refmapJonathan Tan, Nov 11, 2016
  2. Jeff KingNov 11, 2016

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.