Githack: A Persistent Object Store for Lisp Based on Git
Git has a built-in persistent store for objects based on Merkle trees, tailored to store files and directories, but these are just specializations of trees of blobs, so there is no reason it couldn't store Lisp objects. Githack is a Lisp object store that uses Git as its backend, providing persistent objects for Lisp and a transactional interface for manipulating them. Simple atomic objects are stored as blobs and composite objects are stored as trees, supporting standard Lisp composites such as lists, vectors, and hash tables. Custom composite objects can be created through DEFINE-PERSISTENT-STRUCT or DEFCLASS with the :STANDARD-PERSISTENT-METACLASS.
WITH-REPOSITORY is used to specify which repository to use for storing objects, and WITH-TRANSACTION sets up a transaction and retrieves the root object. You use standard slot accessors to walk the object tree, and when done, commit the transaction; modifications are atomically written to the repository with a new root object placed in a Git branch. By putting the database in an orphan Git branch, you can store it beside your source code without tangling histories, letting you use Git to manage, branch, and share the database. Githack even stores object docstrings as README.md files inside the repository trees, making stored objects natively self-documenting in the Git web UI.
Githack supports sophisticated transactional topologies: WITH-TRANSACTION blocks can be nested to create savepoints, allowing speculative Lisp execution that rolls back on error. It dynamically tracks repository mutations during a transaction, and if a transaction spans multiple orphan branches or entirely separate repositories, it automatically upgrades to a fault-tolerant Two-Phase Commit (2PC) using Git Annotated Tags as the transaction ledger, ensuring data consistency even if the Lisp process crashes mid-commit. The project comes with example code and an example database living on its own orphan branch, so cloning the repository also clones a working example database.