summaryrefslogtreecommitdiff
path: root/README.md
blob: b19249080a9fc01fb568bc563042686da1c7c563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
GO libgit2
======
[![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/).

### 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

```sh
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

```go
    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)