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

Re: RefTree: Alternate ref backend

From
Jeff King <peff@peff.net>
Date
Dec 17, 2015, 22:10 UTC
Message-ID
<20151217221045.GA8150@sigill.intra.peff.net>
In-Reply-To
<CAJo=hJvnAPNAdDcAAwAvU9C4RVeQdoS3Ev9WTguHx4fD0V_nOg@mail.gmail.com>
On Thu, Dec 17, 2015 at 01:02:50PM -0800, Shawn Pearce wrote:
> I started playing around with the idea of storing references directly
> in Git. Exploiting the GITLINK tree entry, we can associate a name to
> any SHA-1.

Gitlink entries don't imply reachability, though. I guess that doesn't matter if your ref backend says "no, really, these are the ref tips, and they are reachable". But you could not push the whole thing up to another server and expect it to hold the whole graph.

Which is not strictly necessary, but to me seems like the real advantage of using git objects versus some other system.

Of course, the lack of reachability has advantages, too. You can drop commits pointed to by old reflogs without rewriting the ref history. Unfortunately you cannot expunge the reflogs at all. That's good if you like audit trails. Bad if you are worried that your reflogs will grow large. :)

Show 5 quoted lines
> By storing all references in a single tree, atomic transactions are
> possible. Its a simple compare-and-swap of a single 40 byte SHA-1.
> This of course leads to a bootstrapping problem, where do we store the
> 40 byte SHA-1? For this example its just $GIT_DIR/refs/txn/committed
> as a classical loose reference.

Somehow putting it inside `refs/` seems weird to me, in an infinite recursion kind of way. I would have picked $GIT_DIR/REFSTREE or something. But that is a minor point.

Show 6 quoted lines
> Configuration:
> 
>   [core]
>     repositoryformatversion = 1
>   [extensions]
>     refsBackendType = RefTree

The semantics of extensions config keys are open-ended. The formatVersion=1 spec only says "if there is a key you don't know about, then you may not proceed". Now we're defining a refsBackendType extension. It probably makes sense to write up a few rules (e.g., is RefTree case-sensitive?).

-Peff
Previous: Shawn PearceNext: Shawn Pearce
Message 4 of 18 in “RefTree: Alternate ref backend”
  1. Shawn PearceDec 17, 2015
  2. Junio C HamanoDec 17, 2015
  3. Shawn PearceDec 17, 2015
  4. Jeff KingDec 17, 2015
  5. Shawn PearceDec 17, 2015
  6. Mike HommeyDec 18, 2015
  7. Michael HaggertyDec 22, 2015
  8. Shawn PearceDec 22, 2015
  9. Dave BorowitzDec 22, 2015
  10. Michael HaggertyDec 22, 2015
  11. Shawn PearceDec 22, 2015
  12. Junio C HamanoDec 22, 2015
  13. Shawn PearceDec 22, 2015
  14. Junio C HamanoDec 22, 2015
  15. Michael HaggertyDec 23, 2015
  16. Junio C HamanoDec 24, 2015
  17. Martin FickDec 22, 2015
  18. Junio C HamanoDec 22, 2015

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.