libgit2 v1.3.0 #major (#840)

This commit introduces libgit2 v1.3.0 to git2go, which brings a large
number of [bugfixes and
features](https://github.com/libgit2/libgit2/releases/tag/v1.3.0).

This also marks the start of the v33 release.
This commit is contained in:
lhchavez 2021-10-14 04:42:42 -07:00 committed by GitHub
parent 9b155184fe
commit 6eae74c128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 16 deletions

View File

@ -12,7 +12,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
branch: [ 'release-1.1', 'release-1.0', 'release-0.28', 'release-0.27' ] branch: [ 'release-1.2', 'release-1.1', 'release-1.0', 'release-0.28', 'release-0.27' ]
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -62,7 +62,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
libgit2: libgit2:
- '109b4c887ffb63962c7017a66fc4a1f48becb48e' # v1.2.0 with a fixed symbol - 'v1.3.0'
name: Go (system-wide, dynamic) name: Go (system-wide, dynamic)
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04

View File

@ -10,8 +10,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC #cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 2 || LIBGIT2_VER_MINOR > 2 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 3 || LIBGIT2_VER_MINOR > 3
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.3.0 and v1.3.0"
#endif #endif
*/ */
import "C" import "C"

View File

@ -8,8 +8,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_DYNAMIC #cgo CFLAGS: -DLIBGIT2_DYNAMIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 2 || LIBGIT2_VER_MINOR > 2 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 3 || LIBGIT2_VER_MINOR > 3
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.3.0 and v1.3.0"
#endif #endif
*/ */
import "C" import "C"

View File

@ -8,8 +8,8 @@ package git
#cgo CFLAGS: -DLIBGIT2_STATIC #cgo CFLAGS: -DLIBGIT2_STATIC
#include <git2.h> #include <git2.h>
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 2 || LIBGIT2_VER_MINOR > 2 #if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 3 || LIBGIT2_VER_MINOR > 3
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.2.0 and v1.2.0" # error "Invalid libgit2 version; this git2go supports libgit2 between v1.3.0 and v1.3.0"
#endif #endif
*/ */
import "C" import "C"

View File

@ -10,7 +10,8 @@ Due to the fact that Go 1.11 module versions have semantic meaning and don't nec
| libgit2 | git2go | | libgit2 | git2go |
|---------|---------------| |---------|---------------|
| main | (will be v33) | | main | (will be v34) |
| 1.3 | v33 |
| 1.2 | v32 | | 1.2 | v32 |
| 1.1 | v31 | | 1.1 | v31 |
| 1.0 | v30 | | 1.0 | v30 |
@ -18,13 +19,13 @@ Due to the fact that Go 1.11 module versions have semantic meaning and don't nec
| 0.28 | v28 | | 0.28 | v28 |
| 0.27 | v27 | | 0.27 | v27 |
You can import them in your project with the version's major number as a suffix. For example, if you have libgit2 v1.2 installed, you'd import git2go v32 with: You can import them in your project with the version's major number as a suffix. For example, if you have libgit2 v1.2 installed, you'd import git2go v33 with:
```sh ```sh
go get github.com/libgit2/git2go/v32 go get github.com/libgit2/git2go/v33
``` ```
```go ```go
import "github.com/libgit2/git2go/v32" import "github.com/libgit2/git2go/v33"
``` ```
which will ensure there are no sudden changes to the API. which will ensure there are no sudden changes to the API.
@ -48,7 +49,7 @@ This project wraps the functionality provided by libgit2. If you're using a vers
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 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 ```go
import "github.com/libgit2/git2go/v32" import "github.com/libgit2/git2go/v33"
``` ```
### Versioned branch, static linking ### Versioned branch, static linking
@ -78,7 +79,7 @@ In order to let Go pass the correct flags to `pkg-config`, `-tags static` needs
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 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
replace github.com/libgit2/git2go/v32 ../../libgit2/git2go replace github.com/libgit2/git2go/v33 ../../libgit2/git2go
Parallelism and network operations Parallelism and network operations
---------------------------------- ----------------------------------

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/libgit2/git2go/v32 module github.com/libgit2/git2go/v33
go 1.13 go 1.13

2
vendor/libgit2 vendored

@ -1 +1 @@
Subproject commit 109b4c887ffb63962c7017a66fc4a1f48becb48e Subproject commit b7bad55e4bb0a285b073ba5e02b01d3f522fc95d