update to libgit2 version 1.8.4. dump old github and vendor stuff
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/git2go Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e65b1c188c
commit
530f3618a8
|
@ -1,54 +0,0 @@
|
||||||
name: Backport to older releases
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
backport:
|
|
||||||
name: Backport change to branch ${{ matrix.branch }}
|
|
||||||
continue-on-error: true
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
branch: [ 'release-1.3', 'release-1.2', 'release-1.1', 'release-1.0', 'release-0.28', 'release-0.27' ]
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Create a cherry-pick PR
|
|
||||||
run: |
|
|
||||||
if ! git diff --quiet HEAD^ HEAD -- vendor/libgit2; then
|
|
||||||
echo '::warning::Skipping cherry-pick since it is a vendored libgit2 bump'
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
BRANCH_NAME="cherry-pick-${{ github.run_id }}-${{ matrix.branch }}"
|
|
||||||
|
|
||||||
# Setup usernames and authentication
|
|
||||||
git config --global user.name "${{ github.actor }}"
|
|
||||||
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
|
||||||
cat <<- EOF > $HOME/.netrc
|
|
||||||
machine github.com
|
|
||||||
login ${{ github.actor }}
|
|
||||||
password ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
machine api.github.com
|
|
||||||
login ${{ github.actor }}
|
|
||||||
password ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
EOF
|
|
||||||
chmod 600 $HOME/.netrc
|
|
||||||
|
|
||||||
# Create the cherry-pick commit and create the PR for it.
|
|
||||||
git checkout "${{ matrix.branch }}"
|
|
||||||
git switch -c "${BRANCH_NAME}"
|
|
||||||
git cherry-pick -x "${{ github.sha }}"
|
|
||||||
git push --set-upstream origin "${BRANCH_NAME}"
|
|
||||||
GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" gh pr create \
|
|
||||||
--base "${{ matrix.branch }}" \
|
|
||||||
--title "$(git --no-pager show --format="%s" --no-patch HEAD)" \
|
|
||||||
--body "$(git --no-pager show --format="%b" --no-patch HEAD)"
|
|
|
@ -1,130 +0,0 @@
|
||||||
name: git2go CI
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- release-*
|
|
||||||
- v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build-static:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
go: [ '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17' ]
|
|
||||||
name: Go ${{ matrix.go }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: ${{ matrix.go }}
|
|
||||||
id: go
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
git submodule update --init
|
|
||||||
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
||||||
make build-libgit2-static
|
|
||||||
- name: Test
|
|
||||||
run: make TEST_ARGS=-test.v test-static
|
|
||||||
|
|
||||||
build-dynamic:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
name: Go (dynamic)
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: '1.17'
|
|
||||||
id: go
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
git submodule update --init
|
|
||||||
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
||||||
make build-libgit2-dynamic
|
|
||||||
- name: Test
|
|
||||||
run: make TEST_ARGS=-test.v test-dynamic
|
|
||||||
|
|
||||||
build-system-dynamic:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
libgit2:
|
|
||||||
- 'v1.5.0'
|
|
||||||
name: Go (system-wide, dynamic)
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: '1.17'
|
|
||||||
id: go
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Build libgit2 ${{ matrix.libgit2 }}
|
|
||||||
run: |
|
|
||||||
git submodule update --init
|
|
||||||
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
||||||
sudo env BUILD_LIBGIT_REF=${{ matrix.libgit2 }} ./script/build-libgit2.sh --dynamic --system
|
|
||||||
- name: Test
|
|
||||||
run: make TEST_ARGS=-test.v test
|
|
||||||
|
|
||||||
build-system-static:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
name: Go (system-wide, static)
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: '1.17'
|
|
||||||
id: go
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
- name: Build libgit2
|
|
||||||
run: |
|
|
||||||
git submodule update --init
|
|
||||||
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
||||||
sudo ./script/build-libgit2.sh --static --system
|
|
||||||
- name: Test
|
|
||||||
run: go test --count=1 --tags "static,system_libgit2" ./...
|
|
||||||
|
|
||||||
check-generate:
|
|
||||||
name: Check generated files were not modified
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v1
|
|
||||||
with:
|
|
||||||
go-version: '1.17'
|
|
||||||
id: go
|
|
||||||
- name: Check out code into the Go module directory
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install libgit2 build dependencies
|
|
||||||
run: |
|
|
||||||
git submodule update --init
|
|
||||||
sudo apt-get install -y --no-install-recommends libssh2-1-dev
|
|
||||||
go install golang.org/x/tools/cmd/stringer@latest
|
|
||||||
- name: Generate files
|
|
||||||
run: |
|
|
||||||
export PATH=$(go env GOPATH)/bin:$PATH
|
|
||||||
make generate
|
|
||||||
- name: Check nothing changed
|
|
||||||
run: git diff --quiet --exit-code || (echo "detected changes after generate" ; git status ; exit 1)
|
|
|
@ -1,28 +0,0 @@
|
||||||
name: Tag new releases
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- release-*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
tag-release:
|
|
||||||
name: Bump tag in ${{ github.ref }}
|
|
||||||
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Check out code
|
|
||||||
uses: actions/checkout@v1
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Bump version and push tag
|
|
||||||
id: bump-version
|
|
||||||
uses: anothrNick/github-tag-action@43ed073f5c1445ca8b80d920ce2f8fa550ae4e8d
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
WITH_V: true
|
|
||||||
DEFAULT_BUMP: patch
|
|
||||||
TAG_CONTEXT: branch
|
|
||||||
RELEASE_BRANCHES: .*
|
|
|
@ -1,2 +1,4 @@
|
||||||
/static-build/
|
/static-build/
|
||||||
/dynamic-build/
|
/dynamic-build/
|
||||||
|
|
||||||
|
go.*
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[submodule "vendor/libgit2"]
|
|
||||||
path = vendor/libgit2
|
|
||||||
url = https://github.com/libgit2/libgit2
|
|
|
@ -8,8 +8,5 @@ package git
|
||||||
#cgo CFLAGS: -DLIBGIT2_DYNAMIC
|
#cgo CFLAGS: -DLIBGIT2_DYNAMIC
|
||||||
#include <git2.h>
|
#include <git2.h>
|
||||||
|
|
||||||
#if LIBGIT2_VER_MAJOR != 1 || LIBGIT2_VER_MINOR < 5 || LIBGIT2_VER_MINOR > 5
|
|
||||||
# error "Invalid libgit2 version; this git2go supports libgit2 between v1.5.0 and v1.5.0"
|
|
||||||
#endif
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -1,7 +1,9 @@
|
||||||
TEST_ARGS ?= --count=1
|
TEST_ARGS ?= --count=1
|
||||||
|
|
||||||
default: test
|
default: goimports test
|
||||||
|
|
||||||
|
goimports:
|
||||||
|
goimports -w *.go
|
||||||
|
|
||||||
generate: static-build/install/lib/libgit2.a
|
generate: static-build/install/lib/libgit2.a
|
||||||
go generate --tags "static" ./...
|
go generate --tags "static" ./...
|
||||||
|
@ -10,6 +12,7 @@ generate: static-build/install/lib/libgit2.a
|
||||||
# ==============
|
# ==============
|
||||||
# This uses whatever version of libgit2 can be found in the system.
|
# This uses whatever version of libgit2 can be found in the system.
|
||||||
test:
|
test:
|
||||||
|
go-mod-clean # go install go.wit.com/apps/go-mod-clean@latest
|
||||||
go run script/check-MakeGitError-thread-lock.go
|
go run script/check-MakeGitError-thread-lock.go
|
||||||
go test $(TEST_ARGS) ./...
|
go test $(TEST_ARGS) ./...
|
||||||
|
|
||||||
|
|
12
README.md
12
README.md
|
@ -4,6 +4,18 @@ git2go
|
||||||
|
|
||||||
Go bindings for [libgit2](http://libgit2.github.com/).
|
Go bindings for [libgit2](http://libgit2.github.com/).
|
||||||
|
|
||||||
|
### Updated 2024/12/16
|
||||||
|
|
||||||
|
* 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/git2go
|
||||||
|
```
|
||||||
|
|
||||||
### Which Go version to use
|
### Which Go version to use
|
||||||
|
|
||||||
Due to the fact that Go 1.11 module versions have semantic meaning and don't necessarily align with libgit2's release schedule, please consult the following table for a mapping between libgit2 and git2go module versions:
|
Due to the fact that Go 1.11 module versions have semantic meaning and don't necessarily align with libgit2's release schedule, please consult the following table for a mapping between libgit2 and git2go module versions:
|
||||||
|
|
9
go.mod
9
go.mod
|
@ -1,9 +0,0 @@
|
||||||
module github.com/libgit2/git2go/v34
|
|
||||||
|
|
||||||
go 1.13
|
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4
|
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
|
|
||||||
)
|
|
18
go.sum
18
go.sum
|
@ -1,18 +0,0 @@
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I=
|
|
||||||
github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8=
|
|
||||||
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
|
||||||
github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY=
|
|
||||||
github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I=
|
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw=
|
|
||||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
|
@ -12,6 +12,7 @@ import "C"
|
||||||
import (
|
import (
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -983,7 +984,9 @@ func populateFetchOptions(copts *C.git_fetch_options, opts *FetchOptions, errorT
|
||||||
}
|
}
|
||||||
populateRemoteCallbacks(&copts.callbacks, &opts.RemoteCallbacks, errorTarget)
|
populateRemoteCallbacks(&copts.callbacks, &opts.RemoteCallbacks, errorTarget)
|
||||||
copts.prune = C.git_fetch_prune_t(opts.Prune)
|
copts.prune = C.git_fetch_prune_t(opts.Prune)
|
||||||
copts.update_fetchhead = cbool(opts.UpdateFetchhead)
|
fmt.Println("populateFetchOptions() is broken. fixme!")
|
||||||
|
// fix this line: ./remote.go:988:27: cannot use cbool(opts.UpdateFetchhead) (value of type _Ctype_int) as _Ctype_uint value in assignment
|
||||||
|
// copts.update_fetchhead = cbool(opts.UpdateFetchhead)
|
||||||
copts.download_tags = C.git_remote_autotag_option_t(opts.DownloadTags)
|
copts.download_tags = C.git_remote_autotag_option_t(opts.DownloadTags)
|
||||||
|
|
||||||
copts.custom_headers = C.git_strarray{
|
copts.custom_headers = C.git_strarray{
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit fbea439d4b6fc91c6b619d01b85ab3b7746e4c19
|
|
|
@ -104,7 +104,7 @@ static int set_callback_error(char *error_message, int ret)
|
||||||
{
|
{
|
||||||
if (error_message != NULL) {
|
if (error_message != NULL) {
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
git_error_set_str(GIT_ERROR_CALLBACK, error_message);
|
giterr_set_str(GIT_ERROR_CALLBACK, error_message);
|
||||||
free(error_message);
|
free(error_message);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue