A "super" simple git sub command to use vendor go packages using git submodule (which is automatically supported by go get).
go get github.com/OneOfOne/git-go-vendor
- Make sure
$GOPATH/bin
is in your$PATH
. git go-vendor -h
━➤ git go-vendor -h
NAME:
git-go-vendor - Simple vendoring using git submodules.
USAGE:
git-go-vendor [global options] command [command options] [arguments...]
VERSION:
v0.1
COMMANDS:
list, ls list all current directly vendored packages
add, a adds or replaces a vendor package {git-repo}[@branch|tag|hash] [alias]
update, up updates a vendored package or all of them if non is specified
remove, rm removes the vendor package
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--verbose, -v verbose output (default: false)
--dry-run, -n dry-run, don't actually execute any git commands (default: false)
--git-path value, --git value path to the git executable (default: "git")
--help, -h show help (default: false)
--version, -V print the version (default: false)
━➤ git go-vendor a github.com/OneOfOne/xxhash@449a3a6b
* Added vendor/github.com/OneOfOne/xxhash @ v1.2-14-g449a3a6bec
━➤ git go-vendor ls
* vendor/github.com/OneOfOne/xxhash @ v1.2-14-g449a3a6bec
━➤ git go-vendor rm github.com/OneOfOne/xxhash
* Removed vendor/github.com/OneOfOne/xxhash
━➤ git go-vendor a github.com/OneOfOne/xxhash@449a3a6b github.com/OneOfOne/xxh
* Added github.com/OneOfOne/xxhash @ v1.2-14-g449a3a6bec → vendor/github.com/OneOfOne/xxh
━➤ git go-vendor ls
* github.com/OneOfOne/xxhash @ v1.2-14-g449a3a6bec → vendor/github.com/OneOfOne/xxh
━➤ git commit -a -m 'xxh vendoring'
- Everything else is too complicated and depends on having the vendoring tool installed on the client.
- Managing extra config files overcomplicates vendoring.
- 90% of my use cases depends on using a git repo.
- Look into supporting non-git repos.
This project is released under the MIT license.