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

Re: RFC: New reference iteration paradigm

From
Jeff King <peff@peff.net>
Date
May 29, 2018, 16:52 UTC
Message-ID
<20180529165221.GB13385@sigill.intra.peff.net>
In-Reply-To
<86h8mu1g8j.fsf@gmail.com>
On Sat, May 26, 2018 at 07:25:32PM +0200, Jakub Narebski wrote:
Show 15 quoted lines
> > At one point I wrote a patch to binary search the packed-refs file, find
> > the first "refs/tags/" entry, and then walk linearly through there. What
> > stopped me is that the current refs.c code (I guess file-backend.c these
> > days) was not happy with me partially filling in the ref_dir structs in
> > this "inside out" way.
> [...]
> 
> Isn't this what reftable - an alternative way of storing refs in Git,
> tested by being used by JGit - would solve?  See Christian Couder post
> "Implementing reftable in Git"
> 
>   https://public-inbox.org/git/CAP8UFD0PPZSjBnxCA7ez91vBuatcHKQ+JUWvTD1iHcXzPBjPBg@mail.gmail.com/t/#u
> 
> 'Efficient lookup of an entire namespace, such as refs/tags/' is
> allegedly one of the objectives of this format.
The thread you are responding to is over 2 years old. ;)

Since then, Michael rewrote the packed-refs code to handle this case, and we mmap and binary-search the file since v2.15.

Reftables would also have (amortized) log-n lookup, and also fix some other problems (like lack of atomic transactions). So yes, I hope we do eventually move to reftable, too.

-Peff
Previous: Jakub NarebskiNext: David Turner
Message 6 of 7 in “RFC: New reference iteration paradigm”
  1. Michael HaggertyMar 31, 2016
  2. Junio C HamanoMar 31, 2016
  3. Jeff KingMar 31, 2016
  4. Junio C HamanoMar 31, 2016
  5. Jakub NarebskiMay 26, 2018
  6. Jeff KingMay 29, 2018
  7. David TurnerMar 31, 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.