Awesome
duffer
This is a learning exercise and an API for git
, in that order. Please do not
use this code in production. Instead I would recommend Vincent Hanquez's
excellent and very educational hs-git.
I gave a presentation on this project.
What this library does
- Reads and writes loose blobs, trees, commits, and tags.
- Reads full packfiles.
- Reads and writes git refs.
Some things this library does not do (yet)
- Generate a packfile index from a packfile.
- Support arbitrary backends besides file storage.
- Read .git/index
- Diffs (you can get surprisingly far without them!)
- Provide Functor, Applicative, or Monad instances for a repository, whatever that means.
Goals
Although this is primarily a way for me to learn both Haskell and git
at the
same time, there a couple of (I think) cool things I would like to do with this
library:
- Use
git
as a NoSQL store, i.e. usinggit
data formats to persist data for an application. Irmin is exactly this for OCaml but I don't know of an equivalent in Haskell (although filestore comes close). This means eventually supporting pluggable backends like Irmin andlibgit2
do so that you're not limited to a filesystem backend. - A GraphQL/other query language interface to a
git
repository's commits. If commits form a beautiful acyclic directed graph, there has to be a better way of querying them thangit log
.
Getting Started
- Set up
stack
if you haven't already. - Clone this repository:
git clone git@github.com:vaibhavsagar/duffer.git
cd duffer
stack test
- Tests should all pass. If they don't, please open an issue.