Now that a minimal api is ready, its time that I document how to use it:
Its possible to use the library to deal with repositories, the repository index, low-level object access, commits, revision walking, blobs, git configs and more. Major things that are still not done are dealing with references and trees, which are only waiting on a few issues(mentioned below).
These are rough examples of how to use the major classes.
var repo = new Git2.Repository("/path/to/repository");
Dealing with the index:
var git_index = new Git2.Index();
int ecount = git_index.get_entrycount();
print("Index entry count" + ecount + "\n");
Dealing with objects(specifically commits):
var repo = new Git2.Repository(".");
var hex = "e1380b1f60babf677921c4a9b5e92acda0b15e18";
var git_oid = new Git2.Oid();
var commit1 = new Git2.Commit();
int ctime = commit1.commit_time();
int parentcount = commit1.parentcount();
Dealing with git configuration:
var config = new Git2.Config;
int cfg_val = config.get_int32("help.autocorrect");
Its possible to walk through the DAG(Directed Acyclic Graph) created by parent commits.
I'll point you here to the README for more code and examples.
For many problems that I was facing, I have managed to get around by using UnManaged structs and some C wrapper code, which is not very elegant. e.g it breaks error propagation. I have not yet figured out how to get data out of a UnManaged struct using winxed or how to convert a C string into a Parrot String in winxed. There are many API functions that are waiting on this very issue. Once this is dealt with, I'll align the current API very closely with pygit2, and add more documentation. Till then the source is very easy to read.
Till now, only I have been dealing with my code, so please point out any setup issues that you have.