diff options
-rw-r--r-- | CONTRIBUTING.md | 6 | ||||
-rwxr-xr-x | _support/vendor-gitaly-proto | 16 | ||||
-rw-r--r-- | doc/beginners_guide.md | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d6f5fb985..ade517e4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -257,13 +257,13 @@ The following steps take place inside your Gitaly repo. ```shell # for forks: -govendor fetch gitlab.com/gitlab-org/gitaly-proto/go::gitlab.com/my-user/gitaly-proto/go@my-branch +_support/vendor-gitaly-proto --fork gitlab.com/my-user/gitaly-proto my-branch # for a gitlab-org branch: -govendor fetch gitlab.com/gitlab-org/gitaly-proto/go@my-branch +_support/vendor-gitaly-proto my-branch # if the gitaly-proto version you want to use was already released: -govendor fetch gitlab.com/gitlab-org/gitaly-proto/go@v<tag-version> +_support/vendor-gitaly-proto v<tag-version> ``` - Include the new proto Go code in your next commit with `git add vendor` diff --git a/_support/vendor-gitaly-proto b/_support/vendor-gitaly-proto new file mode 100755 index 000000000..fc4c36f51 --- /dev/null +++ b/_support/vendor-gitaly-proto @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +require 'optparse' +require_relative 'run' + +PROGNAME = 'vendor-gitaly-proto' +USAGE = "Usage: #{PROGNAME} [--fork GITALY_PROTO_FORK_REPO] REVISION" +ORIGIN = 'gitlab.com/gitlab-org/gitaly-proto' + +def main(revision, repo:) + run!(%W[govendor fetch #{ORIGIN}/go::#{repo}/go@#{revision}]) +end + +options = ARGV.getopts(nil, 'fork:') +abort USAGE unless ARGV.count == 1 + +main(ARGV.first, repo: options['fork'] || ORIGIN) diff --git a/doc/beginners_guide.md b/doc/beginners_guide.md index 8ca7aa446..dc8fcc390 100644 --- a/doc/beginners_guide.md +++ b/doc/beginners_guide.md @@ -108,7 +108,7 @@ The Gitaly Proto changes need to be updated in Gitaly itself before the server can be edited. ```bash -$ govendor fetch gitlab.com/gitlab-org/gitaly-proto/go^::gitlab.com/<your-username>/gitaly-proto/go@<your-feature-branch> +$ _support/vendor-gitaly-proto --fork gitlab.com/my-user/gitaly-proto my-branch # change the versions in Gemfile for gitaly-proto # cd ruby |