Home

Awesome

dlibgit

This library provides an idiomatic D interface to the libgit2 library. It is based on the Deimos libgit2 bindings and currently supports versions 0.19.0 and 0.20.0 of libgit2. This library is available as a DUB package.

This project was originally started by Andrej Mitrovic as a set of bindings to libgit2. He since started to implement a D wrapper interface, which was taken up by David Nadlinger. Since some time, Sönke Ludwig has continued the maintainership and completed most of the D API, moving the C bindings to a separate package to make the D API independent of libgit2's development.

Build status

Changes

v0.50.2 - v0.50.4

v0.50.1

v0.50.0

v0.19.0

Notes

Requirements

DMD 2.063+.

Dependencies

Windows:

Posix:

Building libgit2 manually

$ cd <your-folder-of-choice>
$ git clone git://github.com/libgit2/libgit2.git
$ cd libgit2
$ git checkout v0.20.0

Additional Posix notes:

Building and running samples

Samples

<span style="color: red">Note that the samples are not yet ported to the new D API and are currently absent from the repository</span>

diff sample:

$ rdmd build.d diff/diff.d
$ bin\diff.exe .git 2504016ab220b5b 1e8ffc04be048c0

showindex sample:

$ rdmd build.d showindex/showindex.d
$ bin\showindex.exe .git

git client sample: Note: This sample has not been ported to v0.19.0 yet.

$ rdmd build.d samples/network/git.d
$ bin\git.exe ls-remote git://github.com/s-ludwig/dlibgit.git
$ bin\git.exe index-pack path\to\.git\objects\pack\abcd1234.pack
$ bin\git.exe clone git://github.com/s-dludwig/dlibgit.git ../../dlibgit2_clone

On win32 some libgit functions work with either form of slashes, but you should prefer using forward slashes.

Usage tips

As a convenience you can import git.c.all or git.c (with the new 2.064 package import feature) to import all modules at once.

Documentation

You can use the libgit2 API docs. The general example is a good read.

See also

License

See libgit's COPYING file, included in the src/git/c folder. Also see the licensing remarks on the libgit2 github page.

Disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.