Carlos Martín Nieto 688c052f6d Temporarily remove a test
libgit2 recently started caring about the reflog rules and as we use a
bare repo for testing, it does not append.
2014-05-18 11:19:15 +02:00
2014-02-15 19:28:49 +01:00
2014-02-15 01:38:33 +01:00
2014-05-18 11:19:15 +02:00
2013-03-02 12:34:21 +01:00
2013-10-16 13:27:40 +02:00
2013-07-12 18:38:18 +02:00
2012-08-14 00:50:44 +02:00

Geef (Git NIF)

Geef is a simple Erlang NIF that exposes some of the libgit2 library functions to Erlang.

INSTALLING AND RUNNING

First you need to install libgit2:

$ git clone git://github.com/libgit2/libgit2.git
$ cd libgit2
$ make
$ make install

Now, if you have Erlang OTP_R13B04 installed, you can compile this NIF to run in it.

$ git clone git://github.com/carlosmn/geef.git
$ cd geef
$ make
$ mix # if you want to build the elixir modules

The API looks basically like this:

{ok, Repo} = geef_repo:open(".").
Workdir = geef_repo:workdir(Repo).
{ok, Blob} = geef_blob:lookup(Repo, geef_oid:parse("abcde...")).

Elixir

Most functions are available from the elixir modules so you can make use of some elixir-specific things, like Repository.open!, or Reference.resolve!.

alias Geef.Repository
alias Geef.Reference
repo = Repository.open!(".")
ref = Reference.lookup!(repo, "HEAD") |> Reference.resolve!

references, objects, etc are elixir records. Trees implement the Access protocol

Reference[name: name] = Reference.lookup!(repo, "refs/heads/master")
IO.puts name
{:ok, tree} = Tree.lookup(repo, "abcde...")
IO.inspect tree["src/geef_pkt.erl"]

CONTRIBUTING

Fork carlosmn/geef on GitHub, make it awesomer (preferably in a branch named for the topic), send a pull request.

AUTHORS

LICENSE

MIT.

Description
No description provided
Readme 357 KiB
Languages
C 44%
Erlang 39.6%
Elixir 16.2%
Makefile 0.2%