Git to Go; bindings for libgit2. Like McDonald's but tastier.
Go to file
Jeff Carr c9a7e84e5b try build against 1.8.x
Signed-off-by: Jeff Carr <jcarr@wit.com>
2025-01-05 01:21:58 -06:00
script rename as libgit2 2024-12-17 15:01:59 -06:00
testdata/TestGitRepository.git Add `NewCredentialSSHKeyFromSigner` (#706) 2020-12-06 11:55:04 -08:00
.gitignore update to libgit2 version 1.8.4. dump old github and vendor stuff 2024-12-16 17:50:57 -06:00
Build_bundled_static.go rename as libgit2 2024-12-17 15:01:59 -06:00
Build_system_dynamic.go try build against 1.8.x 2025-01-05 01:21:58 -06:00
Build_system_static.go rename as libgit2 2024-12-17 15:01:59 -06:00
LICENSE rename as libgit2 2024-12-17 15:01:59 -06:00
Makefile try build against 1.8.x 2025-01-05 01:21:58 -06:00
README.md rename as libgit2 2024-12-17 15:01:59 -06:00
blame.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
blame_test.go Run the tests in parallel 2016-08-27 19:21:05 +02:00
blob.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
blob_test.go Add support for git_blob_is_binary (#625) 2020-07-30 05:07:05 -07:00
branch.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
branch_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
checkout.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
cherrypick.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
cherrypick_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
clone.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
clone_test.go bugfix: HTTPS Clone fails with remote pointer not found using Go transport (#836) (#842) 2021-10-23 10:33:10 -07:00
commit.go libgit2 v1.2.0 #major 2021-09-05 18:52:01 -07:00
config.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
config_test.go add wrapper for git_config_open_default (#758) 2021-04-03 18:45:55 -07:00
credentials.go Add support for managed SSH transport #minor (#814) 2021-09-05 17:04:40 -07:00
delta_string.go make Delta and DiffLineType stringers 2019-08-27 10:02:12 -07:00
deprecated.go libgit2 v1.2.0 #major 2021-09-05 18:52:01 -07:00
describe.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
describe_test.go Update libgit2 to df4dfaad 2017-01-20 13:20:30 +00:00
diff.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
diff_test.go Refactor all callbacks (#700) 2020-12-05 13:13:59 -08:00
difflinetype_string.go make Delta and DiffLineType stringers 2019-08-27 10:02:12 -07:00
errorclass_string.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
errorcode_string.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
features.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
git.go rename as libgit2 2024-12-17 15:01:59 -06:00
git_test.go Add support for managed HTTP/S transports (#810) 2021-09-05 16:39:07 -07:00
graph.go Add support for Repository.ReachableFromAny() (#826) 2021-09-05 20:06:56 -07:00
graph_test.go Add support for Repository.ReachableFromAny() (#826) 2021-09-05 20:06:56 -07:00
handles.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
http.go rename as libgit2 2024-12-17 15:01:59 -06:00
ignore.go Second round of keep-alives 2017-07-08 11:38:19 +02:00
index.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
index_test.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
indexer.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
indexer_test.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
mempack.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
mempack_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
merge.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
merge_test.go Support git_repository_message, git_repository_message_remove (#734) 2021-02-02 19:42:21 -08:00
message.go Add support for parsing git trailers (#614) 2020-06-02 10:30:42 -07:00
message_test.go Add support for parsing git trailers (#614) 2020-06-02 10:30:42 -07:00
note.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
note_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
object.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
object_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
odb.go Add support for Odb.MultiPackIndex() (#819) 2021-09-05 19:03:26 -07:00
odb_test.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
packbuilder.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
patch.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
patch_test.go Run the tests in parallel 2016-08-27 19:21:05 +02:00
push_test.go Ensure that no pointer handles leak during the test (#712) 2020-12-10 05:35:40 -08:00
rebase.go update to libgit2 version 1.8.4. dump old github and vendor stuff 2024-12-16 17:50:57 -06:00
rebase_test.go update to libgit2 version 1.8.4. dump old github and vendor stuff 2024-12-16 17:50:57 -06:00
refdb.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
reference.go libgit2 v1.2.0 #major 2021-09-05 18:52:01 -07:00
reference_test.go libgit2 v1.2.0 #major 2021-09-05 18:52:01 -07:00
refspec.go Add refspec bindings (#898) 2022-02-24 19:21:35 -08:00
refspec_test.go Add refspec bindings (#898) 2022-02-24 19:21:35 -08:00
remote.go update to libgit2 version 1.8.4. dump old github and vendor stuff 2024-12-16 17:50:57 -06:00
remote_test.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
repository.go Add support for custom smart transports (#806) 2021-09-05 15:44:18 -07:00
repository_test.go Add `Repository.CreateCommitBuffer` (#781) 2021-09-04 13:04:58 -07:00
reset.go More callback refactoring (#713) 2020-12-10 07:19:41 -08:00
reset_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
revert.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
revert_test.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
revparse.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
revparse_test.go Run the tests in parallel 2016-08-27 19:21:05 +02:00
settings.go Add EnableFsyncGitDir to enable synchronized writes to the gitdir (#874) 2022-01-17 18:51:39 -08:00
settings_test.go Add EnableFsyncGitDir to enable synchronized writes to the gitdir (#874) 2022-01-17 18:51:39 -08:00
signature.go Check nil signature 2020-04-23 16:26:35 -07:00
ssh.go Make ssh commands used in the git smart transport compatible with libgit2 (#852) 2021-11-07 12:20:56 -08:00
stash.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
stash_test.go Mark some symbols to be deprecated #minor (#698) 2020-12-05 07:23:44 -08:00
status.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
status_test.go Fix null pointer dereference in status.ByIndex (#628) 2020-08-14 11:19:21 -07:00
submodule.go Make all Options objects consistent 2021-09-05 18:52:01 -07:00
submodule_test.go The big Callback type adjustment of 2020 2021-09-05 18:52:01 -07:00
tag.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
tag_test.go Run the tests in parallel 2016-08-27 19:21:05 +02:00
transport.go rename as libgit2 2024-12-17 15:01:59 -06:00
transport_test.go Add support for custom smart transports (#806) 2021-09-05 15:44:18 -07:00
tree.go Allow skipping an entry expansion in `tree.Walk()` (#838) 2021-09-30 09:24:49 -07:00
tree_test.go Allow skipping an entry expansion in `tree.Walk()` (#838) 2021-09-30 09:24:49 -07:00
walk.go Make all non-user-creatable structures non-comparable (#802) 2021-09-05 13:59:36 -07:00
wrapper.c update to libgit2 version 1.8.4. dump old github and vendor stuff 2024-12-16 17:50:57 -06:00

README.md

GO libgit2

GoDoc Build Status

Go bindings for libgit2.

Updated 2024/12/16

Which Go version to use

  • This package is updated to work against libgit2 version 1.8 on Debian sid
  • There is one line commented out which needs to be fixed in remote.go
  • some of the tests seem to run
go install go.wit.com/apps/go-clone@latest
go install go.wit.com/apps/go-mod-clean@latest
go-clone --recusive go.wit.com/lib/libgit2

Which branch to send Pull requests to

TODO: not sure yet

Installing

This project wraps the functionality provided by libgit2. It thus needs it in order to perform the work.

This project wraps the functionality provided by libgit2. If you're using a versioned branch, install it to your system via your system's package manager and then install libgit2.

Versioned branch, dynamic linking

When linking dynamically against a released version of libgit2, install it via your system's package manager. CGo will take care of finding its pkg-config file and set up the linking. Import via Go modules, e.g. to work against libgit2 v1.2

    goimports -w *.go

Parallelism and network operations

libgit2 may use OpenSSL and LibSSH2 for performing encrypted network connections. For now, libgit2 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

For the stable version, go test will work as usual. For the main branch, similarly to installing, running the tests requires building a local libgit2 library, so the Makefile provides a wrapper that makes sure it's built

make test-static

Alternatively, you can build the library manually first and then run the tests

make install-static
go test -v -tags static ./...

License

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

Authors

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