diff options
| author | Rob Pike <r@golang.org> | 2018-01-22 10:39:38 +1100 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2018-01-22 04:07:14 +0000 |
| commit | f5dbde0c1ab9393757674eb259f2de6e40f1a7b3 (patch) | |
| tree | 835b0383d49927ed320b5de9f7832299a980168b /git-codereview | |
| parent | 40351d005dee5f35259c1bca836e9dbbf842d119 (diff) | |
| download | go-x-review-f5dbde0c1ab9393757674eb259f2de6e40f1a7b3.tar.xz | |
review/git-codereview: use more verbosity to signal verbose pulls
The -v flag in review is already used to signal more verbose output.
With one -v, git sync shows the git commands. After this change,
two -vs (or -v=2) causes git sync to pass -v to git pull as well.
Also mention that -v is a counter not a boolean in the documentation.
Change-Id: I584068f05c2298be6ae2e6ae17a0b817dc6a092f
Reviewed-on: https://go-review.googlesource.com/88875
Reviewed-by: Andrew Gerrand <adg@golang.org>
Diffstat (limited to 'git-codereview')
| -rw-r--r-- | git-codereview/doc.go | 3 | ||||
| -rw-r--r-- | git-codereview/sync.go | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/git-codereview/doc.go b/git-codereview/doc.go index a7b04b5..890cb9d 100644 --- a/git-codereview/doc.go +++ b/git-codereview/doc.go @@ -96,7 +96,8 @@ Command Details All commands accept these global flags: -The -v flag prints all commands that make changes. +The -v flag prints all commands that make changes. Multiple occurrences +trigger more verbosity in some commands, including sync. The -n flag prints all commands that would be run, but does not run them. diff --git a/git-codereview/sync.go b/git-codereview/sync.go index 5cba5bc..dc03c61 100644 --- a/git-codereview/sync.go +++ b/git-codereview/sync.go @@ -27,7 +27,11 @@ func cmdSync(args []string) { // We want to pull in the remote changes from the upstream branch // and rebase the current pending commit (if any) on top of them. // If there is no pending commit, the pull will do a fast-forward merge. - run("git", "pull", "-q", "-r", "origin", strings.TrimPrefix(b.OriginBranch(), "origin/")) + if *verbose > 1 { + run("git", "pull", "-q", "-r", "-v", "origin", strings.TrimPrefix(b.OriginBranch(), "origin/")) + } else { + run("git", "pull", "-q", "-r", "origin", strings.TrimPrefix(b.OriginBranch(), "origin/")) + } // If the change commit has been submitted, // roll back change leaving any changes unstaged. |
