Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carlosmn/geef
Git NEEEEF (Erlang NIF)
https://github.com/carlosmn/geef
Last synced: about 6 hours ago
JSON representation
Git NEEEEF (Erlang NIF)
- Host: GitHub
- URL: https://github.com/carlosmn/geef
- Owner: carlosmn
- Fork: true (schacon/geef)
- Created: 2012-08-13T22:00:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-03-06T20:58:31.000Z (over 5 years ago)
- Last Synced: 2023-11-07T19:18:29.023Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 320 KB
- Stars: 126
- Watchers: 8
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-technostructure - carlosmn/geef
- awesome-technostructure - carlosmn/geef
README
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 installNow, 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 modulesThe API looks basically like this:
```erlang
{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!`.```elixir
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
```elixir
%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
==============* Carlos Martín Nieto
* Scott ChaconLICENSE
==============MIT.