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.
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
gitas a NoSQL store, i.e. using
gitdata 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 and
libgit2do so that you're not limited to a filesystem backend.
- A GraphQL/other query language interface to a
gitrepository's commits. If commits form a beautiful acyclic directed graph, there has to be a better way of querying them than
- Set up
stackif you haven't already.
- Clone this repository:
git clone firstname.lastname@example.org:vaibhavsagar/duffer.git
- Tests should all pass. If they don't, please open an issue.