6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-05 01:29:42 +00:00

Remove git2go and replace it with go-git

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-26 11:34:32 +02:00
parent 7ab4489dfe
commit 632fb4a9c8
4 changed files with 1 additions and 39 deletions

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "static/git2go"]
path = static/git2go
url = https://github.com/libgit2/git2go.git

View File

@@ -2,38 +2,6 @@
`git get` - a better way to clone and manage git repositories.
## Build
How to build with `libgit2` statically linked into a single executable without dependencies:
- Install development packages for libssh2 and openssl:
```
sudo apt install libssh2-1-dev libssl-dev
```
- Inside the `static` folder there's the `git2go` library added as a submodule (pointing to a correct v30 release).
This, in turn, contains `libgit2` submodule. To ensure the submodules are cloned run:
```
git submodule update --init --recursive
```
- Build the static `git2go` library:
```
cd static/git2go && make install-static
```
- Ensure our `git-get` module uses the static `git2go` library instead of the one downloaded by Go modules by having
the following line in `go.mod`:
```
replace github.com/libgit2/git2go/v30 => ./static/git2go
```
- Build, install and test `git-get` with `--tags static` flag, eg:
```
go build -i --tags static
go test --tags static
```
## Features
Show repo status:

4
go.mod
View File

@@ -3,10 +3,8 @@ module git-get
go 1.14
require (
github.com/libgit2/git2go/v30 v30.0.3
github.com/go-git/go-git/v5 v5.1.0
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
)
replace github.com/libgit2/git2go/v30 => ./static/git2go

Submodule static/git2go deleted from 31f877e249