Git to Go; bindings for libgit2. Like McDonald's but tastier.
Go to file
David Calavera 22f4a4edaa Do not double check if the signature is nil. 2015-01-08 14:21:29 -08:00
script Revert "Make the cgo tool do more linking work" 2014-12-31 19:43:20 +00:00
vendor Add Submodule.Update method. 2015-01-08 13:44:58 -08:00
.gitmodules Remove left-over submodule configuration 2014-06-07 19:29:45 +02:00
.travis.yml travis: build with Go 1.3 2014-07-03 08:48:41 +02:00
LICENSE Initial commit 2013-03-05 20:53:04 +01:00
Makefile Revert "Make the cgo tool do more linking work" 2014-12-31 19:43:20 +00:00
README.md Merge pull request #146 from stevenwilkin/add-build-status 2014-12-05 16:41:23 +01:00
blame.go add (*Blame).HunkByLine (git_blame_get_hunk_byline) and test 2014-11-18 05:06:03 -08:00
blame_test.go add (*Blame).HunkByLine (git_blame_get_hunk_byline) and test 2014-11-18 05:06:03 -08:00
blob.go Remove useless includes 2014-12-11 02:59:07 +01:00
blob_test.go Add a test for blobs 2014-10-15 16:59:19 +02:00
branch.go Remove useless includes 2014-12-11 02:59:07 +01:00
branch_test.go merge with improved error handling logic 2014-04-04 00:56:58 -07:00
checkout.go Make the constants have types 2014-10-28 11:29:31 +01:00
clone.go Remove useless includes 2014-12-11 02:59:07 +01:00
clone_test.go Clean up after the tests 2014-03-19 08:15:19 +01:00
commit.go Remove useless includes 2014-12-11 02:59:07 +01:00
config.go Remove useless includes 2014-12-11 02:59:07 +01:00
credentials.go Remove useless includes 2014-12-11 02:59:07 +01:00
diff.go Add git_diff_get_stats() 2015-01-04 12:13:46 +00:00
diff_test.go Add git_diff_get_stats() 2015-01-04 12:13:46 +00:00
git.go Update to libgit2 master 2015-01-04 17:05:11 +00:00
git_test.go test: adjust to safe commit append 2014-05-03 19:13:32 +02:00
index.go Remove useless includes 2014-12-11 02:59:07 +01:00
index_test.go implemented Index.AddAll, Index.RemoveAll, Index.UpdateAll 2014-10-24 21:55:08 +02:00
merge.go Remove useless includes 2014-12-11 02:59:07 +01:00
merge_test.go Update to master 2014-12-03 17:26:55 +01:00
object.go Remove useless includes 2014-12-11 02:59:07 +01:00
object_test.go Give Object and Reference an Onwer accessor 2014-05-25 09:12:10 +02:00
odb.go Remove useless includes 2014-12-11 02:59:07 +01:00
odb_test.go Odb: use a callback instead of a channel for ForEach 2014-05-06 14:19:34 +02:00
packbuilder.go Remove useless includes 2014-12-11 02:59:07 +01:00
patch.go Add missing thread-locking 2014-12-11 02:46:42 +01:00
patch_test.go don't expose 3 different diff foreach methods. use structures instead of pointers to structures for diff detail. add patch error code handling. trim excess data from diff structures. 2014-03-21 22:51:38 -07:00
push_test.go Update to libgit2 master 2015-01-04 17:05:11 +00:00
refdb.go Remove useless includes 2014-12-11 02:59:07 +01:00
reference.go Remove useless includes 2014-12-11 02:59:07 +01:00
reference_test.go Give Object and Reference an Onwer accessor 2014-05-25 09:12:10 +02:00
remote.go Update to libgit2 master 2015-01-04 17:05:11 +00:00
remote_test.go Make the constants have types 2014-10-28 11:29:31 +01:00
repository.go Update to libgit2 master 2015-01-04 17:05:11 +00:00
revparse.go Remove useless includes 2014-12-11 02:59:07 +01:00
revparse_test.go Extract data into a go struct. 2014-08-22 22:36:18 -07:00
settings.go Move the settings into the main git2go 2014-06-07 18:57:46 +02:00
settings_test.go Move the settings into the main git2go 2014-06-07 18:57:46 +02:00
status.go Remove useless includes 2014-12-11 02:59:07 +01:00
status_test.go fix status list to handle null head_to_index in entries 2014-08-25 23:18:00 -04:00
submodule.go Do not double check if the signature is nil. 2015-01-08 14:21:29 -08:00
tag.go add support for annotated tags 2014-06-09 23:19:17 +02:00
tag_test.go add support for annotated tags 2014-06-09 23:19:17 +02:00
tree.go Update libgit2 2014-12-18 22:59:08 +00:00
walk.go Remove useless includes 2014-12-11 02:59:07 +01:00
wrapper.c Update to libgit2 master 2015-01-04 17:05:11 +00:00

README.md

git2go

GoDoc Build Status

Go bindings for libgit2. The master branch follows the latest libgit2 release.

Installing

This project needs libgit2, which is written in C so we need to build that as well. In order to build libgit2, you need cmake, pkg-config and a C compiler. You will also need the development packages for OpenSSL and LibSSH2 if you want to use HTTPS and SSH respectively.

Run go get -d github.com/libgit2/git2go to download the code and go to your $GOPATH/src/github.com/libgit2/git2go dir. From there, we need to build the C code and put it into the resulting go binary.

git submodule update --init # get libgit2
make install

will compile libgit2 and run go install such that it's statically linked to the git2go package.

Paralellism and network operations

libgit2 uses OpenSSL and LibSSH2 for performing encrypted network connections. For now, git2go asks libgit2 to set locking for OpenSSL. This makes HTTPS connections thread-safe, but it is fragile and will likely stop doing it soon. This may also make SSH connections thread-safe if your copy of libssh2 is linked against OpenSSL. Check libgit2's THREADSAFE.md for more information.

Running the tests

Similarly to installing, running the tests requires linking against the local libgit2 library, so the Makefile provides a wrapper

make test

alternatively, if you want to pass arguments to go test, you can use the script that sets it all up

./script/with-static.sh go test -v

which will run the specified arguments with the correct environment variables.

License

M to the I to the T. See the LICENSE file if you've never seen a MIT license before.

Authors

  • Carlos Martín (@carlosmn)
  • Vicent Martí (@vmg)