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

Re: Why are ref_lists sorted?

From
Junio C Hamano <junkio@cox.net>
Date
Mar 19, 2007, 05:42 UTC
Message-ID
<7vd535lrgc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070319053331.GA22534@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> We already have the ISPACKED flag in the flags field to tell us if
> the ref is loose or not.  When inserting a ref into the hash table
> you keep the loose version (either if its in the table, or the one
> being inserted).

As long as you are careful enough not to break the unwrapped entries, repacking and re-reading of refs (I think these three are the reasons we have separate lists), I am fine with that change. I also think some callers of do_for_each_refs (this includes the userland that use git-for-each-ref and/or git-show-ref) expect the traversal to be sorted, so I would like to keep that sorted output behaviour.

An additional hash to speed up look-up operation is probably a good thing to have.

Previous: Shawn O. PearceNext: Linus Torvalds
Message 6 of 7 in “Why are ref_lists sorted?”
  1. Julian PhillipsMar 19, 2007
  2. Junio C HamanoMar 19, 2007
  3. Shawn O. PearceMar 19, 2007
  4. Julian PhillipsMar 19, 2007
  5. Shawn O. PearceMar 19, 2007
  6. Junio C HamanoMar 19, 2007
  7. Linus TorvaldsMar 19, 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.