README.md

ocaml-git -- Git format and protocol in pure OCaml

Support for on-disk and in-memory Git stores. Can read and write all
the Git objects: the usual blobs, trees, commits and tags but also
the pack files, pack indexes and the index file (where the staging area
lives).

All the objects share a consistent API, and convenience functions are
provided to manipulate the different objects. For instance, it is
possible to make a pack file position independent (as the Zlib
compression might change the relative offsets between the packed
objects), to generate pack indexes from pack files, or to expand
the filesystem of a given commit.

The library comes with a command-line tool called ogit which shares
a similar interface with git, but where all operations are mapped to
the API exposed ocaml-git (and hence using only OCaml code).

What is supported

The pack files
(collections of compressed loose objects using a binary-diff representation)
and pack indexes
(indexes of pack files) can be read and
written). The binary diff hunks are exposed using a high-level
position-independent representation so that they can be manipulated
more easily. Pack file can be created but will not be compressed yet.

The index file
(used as for managing the staging area)
are fully supported. Which means that git diff and git status
will work as expected on a repository created by the library.

Cloning and fetching
(using various options) are fully supported for
the Git protocol, the smart-HTTP protocol and git+ssh. A subset
of the protocol capabilities are implemented (mainly thin-pack,
ofs-delta, side-band-64k and allow-reachable-sha1-in-want).

Pushing is still experimental and needs more testing.

An abstraction for Git Store
Is available. Various store implementations are available: