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

Re: [PATCH] refs.c: drop duplicate entries in sort_ref_list

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Apr 19, 2007, 08:19 UTC
Message-ID
<4627262A.463AA87D@eudaptics.com>
In-Reply-To
<20070418212749.4842.62822.julian@quantumfyre.co.uk>
Julian Phillips wrote:
Show 5 quoted lines
> 
> It shouldn't happen that we read duplicate entries into the same list,
> but just in case make sort_ref_list drop them.  If the SHA1s don't
> match then die instead, as we have no way of knowing which one is the
> correct one.
Clone a random repository that has tags, then

$ rm .git/refs/tags/* $ git fetch origin

now lists each tag twice: for the tag object itself and the commit it points to. Is this related to the problem you are solving here? If so, dying is probably not the best in this situation since the tags are still unique.

(rm .git/refs/tags/* may be insane, but just the other day I wanted to clean up my repo from a number of unneeded branches as well as the tags that they contained - to find out that it is not enough to remove the refs: the objects must go away too, otherwise git fetch auto-follows them and the tags come back even though the branch heads are not there anymore.)

$ git version git version 1.5.1.1.27.g91776

-- Hannes
Previous: Julian PhillipsNext: Julian Phillips
Message 10 of 12 in “refs.c: add a function to sort a ref list, rather then sorting on add”
  1. refs.c: add a function to sort a ref list, rather then sorting on addJulian Phillips, Apr 17, 2007
  2. Linus TorvaldsApr 17, 2007
  3. Julian PhillipsApr 17, 2007
  4. Linus TorvaldsApr 17, 2007
  5. Julian PhillipsApr 17, 2007
  6. Junio C HamanoApr 17, 2007
  7. Julian PhillipsApr 17, 2007
  8. Junio C HamanoApr 18, 2007
  9. refs.c: drop duplicate entries in sort_ref_listJulian Phillips, Apr 18, 2007
  10. Johannes SixtApr 19, 2007
  11. Julian PhillipsApr 19, 2007
  12. Julian PhillipsApr 17, 2007

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.