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
Julian Phillips <julian@quantumfyre.co.uk>
Date
Apr 19, 2007, 08:49 UTC
Message-ID
<Pine.LNX.4.64.0704190934480.30526@reaper.quantumfyre.co.uk>
In-Reply-To
<4627262A.463AA87D@eudaptics.com>
On Thu, 19 Apr 2007, Johannes Sixt wrote:
Show 16 quoted lines
> Julian Phillips wrote:
>>
>> 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.

The sort function is only looking at refs. So if you rm .git/refs/tags/* then you don't have any tag refs (assuming no packed-refs). What it is talking about is having two instances of (e.g.) refs/tags/foo.

In the situation you mention above you still shouldn't see duplicated refs.

-- 
Julian

  ---

Ah, so that's what's been wrong with the little fella.  He misses
casual sex.

 		-- Homer Simpson
 		   Two Dozen and One Greyhounds
Previous: Johannes SixtNext: Julian Phillips
Message 11 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.