git-codereview: new sync-branch and related fixes

This CL adds a new command, "git codereview sync-branch",
which does the appropriate git merge for the current branch.

This CL also fixes a bug in "git codereview branchpoint",
and therefore also commands like "git codereview pending",
which was getting the branchpoint wrong for merges,
with the effect that a merge showed too many pending CLs.

This CL also fixes a bug in "git codereview change", which was
formerly willing to run "git checkout" with a pending merge,
which had the effect of flattening the merge mysteriously.
Now it detects the merge and refuses to run.

All of this should make merges easier and less error-prone
as we use dev branches more often.

With the earlier CL in this stack that allows working directly
on local branches, this is now a great way to run a merge
updating dev.regabi:

	git change dev.regabi
	git sync-branch

(with appropriate aliases to avoid typing "codereview").

Fixes golang/go#26201.

Change-Id: Ic24603123ca5135a72004309f5bb208ff149c9eb
Reviewed-on: https://go-review.googlesource.com/c/review/+/279772
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
10 files changed
tree: 774f94b2ae37b5e08a68504122663656f29e471c
  1. git-codereview/
  2. .gitattributes
  3. AUTHORS
  4. codereview.cfg
  5. CONTRIBUTING.md
  6. CONTRIBUTORS
  7. go.mod
  8. LICENSE
  9. PATENTS
  10. README.md
README.md

git-codereview

The git-codereview tool is a command-line tool for working with Gerrit.

Download/Install

The easiest way to install is to run go get -u golang.org/x/review/git-codereview. You can also manually git clone the repository to $GOPATH/src/golang.org/x/review.

Run git codereview hooks to install Gerrit hooks for your git repository.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the review repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/review:” in the subject line, so it is easy to find.