This repo is outdated. The latest fork is to be found here: https://github.com/theseion/LibGit (2014-09-25)
LibGit aims to be an object-oriented and complete binding for the libgit2 library for Pharo and Squeak Smalltalk. It is based on the NativeBoostFFI and requires a CogVM with NativeBoost support.
LibGit requires VM-support for NativeBoost. Suitable VMs are available from the Pharo project: NBCog
Currently, LibGit is developed on Pharo 2.0 and is not tested with Squeak.
Furthermore, it requires a recent version of NativeBoost with support for C enums. To install a suitable version of NativeBoost and the latest version of LibGit execute the following expression:
Gofer new
smalltalkhubUser: 'StefanMarr' project: 'LibGit';
package: #ConfigurationOfLibGit;
load.
(Smalltalk at: #ConfigurationOfLibGit) loadBleedingEdge.
While LibGit is currently in the prototyping phase, a few simple things are already possible. Try the following simple queries on a git repository of your choice:
repo := LGitRepository on: '~/tmp/libgit' asFileReference. "Open the repo"
repo branches. "get a list of branches"
head := repo head. "look up the HEAD"
head isHead. "some basic info"
head name.
"look up the corresponding commit"
commit := head commit.
commit author.
commit committer.
commit message.
commit time.
LibGit is currently just a simple prototype of a libgit2 binding. The goal is to have a fully object-oriented binding that can be the backend for a Monticello repository based on FileTree. However, most of the required functionality is still missing and contributions are welcome.
The source code of LibGit is maintained on SmalltalkHub and mirrored to GitHub.
LibGit is published under the MIT license. All contributions to this project are automatically under the MIT license if not stated otherwise.
The provided bindings are based on bindings generated by Ciprian Teodorov's TalkFFI. The manual adaptation were mainly applied to streamline the interface and avoid non-essential dependencies.