aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/review.go
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2016-03-01 15:04:52 -0300
committerAndrew Gerrand <adg@golang.org>2016-09-15 00:16:11 +0000
commit50528ca764718386baa44c0daec70913cf14addc (patch)
treef821b87070e4fffd4ec535eb1d90daa7c085fb07 /git-codereview/review.go
parente143ba9c054637a068c21480cee8249caa0d8f9f (diff)
downloadgo-x-review-50528ca764718386baa44c0daec70913cf14addc.tar.xz
git-codereview: allow changing to a CL
Now 'git change NNNN/PP' can be used to checkout (detached) the git commit corresponding to the patchset PP of the change NNNN. If the patchset is omitted, the current (latest) will be used. Branch names that are only numbers or numbers separated by a slash will always be understood as refering to CL. This break workflows that were using numbers as branch names, but this is expected to be uncommon. The workaround in this case is to use checkout directly. It gets the commit fetching the specific reference inside origin's refs/changes/ and check it out. It uses the gerrit API only if querying the current patchset is needed. Given that it's easy to mistype the number, change to a CL will show the subject of the commit it just checked out. Fixes golang/go#9255. Change-Id: I01b98f4672051a52b8b9110a41d93f3ffefebaf1 Reviewed-on: https://go-review.googlesource.com/20101 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'git-codereview/review.go')
-rw-r--r--git-codereview/review.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-codereview/review.go b/git-codereview/review.go
index c83a95b..4d2ebe6 100644
--- a/git-codereview/review.go
+++ b/git-codereview/review.go
@@ -63,6 +63,11 @@ Available commands:
If -a is specified, automatically add any unstaged changes in
tracked files during commit.
+ change NNNN[/PP]
+ Checkout the commit corresponding to CL number NNNN and
+ patch set PP from Gerrit.
+ If the patch set is omitted, use the current patch set.
+
gofmt [-l]
Run gofmt on all tracked files in the staging area and the
working tree.