Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any native git command line tool based on libgit2?

Tags:

libgit2

As libgit2 is a library, is there any existing C/C++ project which depends on libgit2 and exposes the usual Git command line interfaces (like git clone, git commit, etc.)?

like image 864
Thomson Avatar asked May 25 '15 02:05

Thomson


People also ask

Does GIT use Libgit2?

Libgit2 is a dependency-free implementation of Git, with a focus on having a nice API for use within other programs.


2 Answers

The closer you may find is in the examples folder of the libgit2 project.

As stated by the README

These examples are a mixture of basic emulation of core Git command line functions and simple snippets demonstrating libgit2 API usage (for use with Docurium). As a whole, they are not vetted carefully for bugs, error handling, and cross-platform compatibility in the same manner as the rest of the code in libgit2, so copy with caution.

That being said, you are welcome to copy code from these examples as desired when using libgit2. They have been released to the public domain, so there are no restrictions on their use.

One of the long term goal of the libgit2 project would be to run the whole git.git tests against those examples (to ensure compatibility with the core git implementation), so there's a reasonable chance they'll keep on evolving.

like image 92
nulltoken Avatar answered Oct 18 '22 02:10

nulltoken


From time to time there is some project which tries to reimplement the git tool on top of libgit2 or one of the bindings, but these don't tend to go very far.

The git interface is a collection of quirks, and it's not a very rewarding job to reimplement them in your own tool. To add to that, if you do go through and reimplement the interface, what you get is to have a version of git with mismatched features, which is what you had before you even started.

The are some systems where it might be worth going through all the trouble is to avoid having to have the unix-like environment with shell or perl, but there is also effort to port those parts of git to C as well, which tackles this from the other side.

like image 30
Carlos Martín Nieto Avatar answered Oct 18 '22 02:10

Carlos Martín Nieto