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