git2go/README.md

70 lines
2.4 KiB
Markdown
Raw Normal View History

2024-12-17 15:01:59 -06:00
GO libgit2
2013-03-05 13:53:04 -06:00
======
2024-12-17 15:01:59 -06:00
[![GoDoc](https://godoc.org/go.wit.com/lib/libgit2?status.svg)](http://godoc.org/go.wit.com/lib/libgit2) [![Build Status](https://travis-ci.org/libgit2/libgit2.svg?branch=main)](https://travis-ci.org/libgit2/libgit2)
Go bindings for [libgit2](http://libgit2.github.com/).
2013-03-05 13:53:04 -06:00
### Updated 2024/12/16
2024-12-17 15:01:59 -06:00
### 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
```sh
go install go.wit.com/apps/go-clone@latest
go install go.wit.com/apps/go-mod-clean@latest
2024-12-17 15:01:59 -06:00
go-clone --recusive go.wit.com/lib/libgit2
```
### Which branch to send Pull requests to
2024-12-17 15:01:59 -06:00
TODO: not sure yet
Installing
----------
This project wraps the functionality provided by libgit2. It thus needs it in order to perform the work.
2024-12-17 15:01:59 -06:00
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
2015-03-14 19:21:21 -05:00
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
2015-03-14 19:21:21 -05:00
```go
2024-12-17 15:01:59 -06:00
goimports -w *.go
```
2015-07-29 04:28:34 -05:00
Parallelism and network operations
2014-12-02 18:50:37 -06:00
----------------------------------
2024-12-17 15:01:59 -06:00
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.
2014-12-02 18:50:37 -06:00
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 ./...
2013-03-05 13:53:04 -06:00
License
-------
2017-07-11 22:58:08 -05:00
M to the I to the T. See the LICENSE file if you've never seen an MIT license before.
2013-03-05 13:53:04 -06:00
Authors
-------
2024-12-17 15:01:59 -06:00
- Carlos Martín (github@carlosmn)
- Vicent Martí (github@vmg)
2013-03-05 13:53:04 -06:00