Skip to content

Commit ad3ec36

Browse files
Create v31 to support libgit2 v1.1.x (libgit2#668)
The libgit2 `v1.1.0` is released two weeks ago. This PR allows `git2go` to link against the new version.
1 parent f83530b commit ad3ec36

File tree

7 files changed

+19
-17
lines changed

7 files changed

+19
-17
lines changed

.github/workflows/backport.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77
jobs:
88

99
backport:
10+
name: Backport change to branch ${{ matrix.branch }}
11+
continue-on-error: true
1012
strategy:
1113
fail-fast: false
1214
matrix:
13-
branch: [ 'release-0.28', 'release-0.27' ]
14-
name: Backport change to branch ${{ matrix.branch }}
15+
branch: [ 'release-0.30', 'release-0.28', 'release-0.27' ]
1516

1617
runs-on: ubuntu-20.04
1718

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,20 @@ Due to the fact that Go 1.11 module versions have semantic meaning and don't nec
1010

1111
| libgit2 | git2go |
1212
|---------|---------------|
13-
| master | (will be v31) |
13+
| master | (will be v32) |
14+
| 1.1 | v31 |
1415
| 1.0 | v30 |
1516
| 0.99 | v29 |
1617
| 0.28 | v28 |
1718
| 0.27 | v27 |
1819

19-
You can import them in your project with the version's major number as a suffix. For example, if you have libgit2 v1.0 installed, you'd import git2go v30 with
20+
You can import them in your project with the version's major number as a suffix. For example, if you have libgit2 v1.1 installed, you'd import git2go v31 with:
2021

2122
```sh
22-
go get github.com/libgit2/git2go/v30
23+
go get github.com/libgit2/git2go/v31
2324
```
2425
```go
25-
import "github.com/libgit2/git2go/v30"
26+
import "github.com/libgit2/git2go/v31"
2627
```
2728

2829
which will ensure there are no sudden changes to the API.
@@ -43,10 +44,10 @@ This project wraps the functionality provided by libgit2. If you're using a vers
4344

4445
### Versioned branch, dynamic linking
4546

46-
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.0
47+
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.1
4748

4849
```go
49-
import "github.com/libgit2/git2go/v30"
50+
import "github.com/libgit2/git2go/v31"
5051
```
5152

5253
### Versioned branch, static linking
@@ -76,7 +77,7 @@ In order to let Go pass the correct flags to `pkg-config`, `-tags static` needs
7677

7778
One thing to take into account is that since Go expects the `pkg-config` file to be within the same directory where `make install-static` was called, so the `go.mod` file may need to have a [`replace` directive](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) so that the correct setup is achieved. So if `git2go` is checked out at `$GOPATH/src/github.com/libgit2/git2go` and your project at `$GOPATH/src/github.com/my/project`, the `go.mod` file of `github.com/my/project` might need to have a line like
7879

79-
replace github.com/libgit2/git2go/v30 ../../libgit2/git2go
80+
replace github.com/libgit2/git2go/v31 ../../libgit2/git2go
8081

8182
Parallelism and network operations
8283
----------------------------------

git_bundled_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ package git
99
#cgo CFLAGS: -DLIBGIT2_STATIC
1010
#include <git2.h>
1111
12-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 0
13-
# error "Invalid libgit2 version; this git2go supports libgit2 v1.0"
12+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
13+
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
1414
#endif
1515
*/
1616
import "C"

git_system_dynamic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package git
77
#cgo CFLAGS: -DLIBGIT2_DYNAMIC
88
#include <git2.h>
99
10-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 0
11-
# error "Invalid libgit2 version; this git2go supports libgit2 v1.0"
10+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
11+
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
1212
#endif
1313
*/
1414
import "C"

git_system_static.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package git
77
#cgo CFLAGS: -DLIBGIT2_STATIC
88
#include <git2.h>
99
10-
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 0
11-
# error "Invalid libgit2 version; this git2go supports libgit2 v1.0"
10+
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR != 1
11+
# error "Invalid libgit2 version; this git2go supports libgit2 v1.1"
1212
#endif
1313
*/
1414
import "C"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/libgit2/git2go/v30
1+
module github.com/libgit2/git2go/v31
22

33
go 1.13
44

vendor/libgit2

Submodule libgit2 updated 703 files

0 commit comments

Comments
 (0)