git-review: make 'git change topic' with no staged changes not commit

I expect that many people (myself included) will sometimes have in
mind what they're going to do and run 'git change topic' before making
any edits. Before this CL, what that does is create a new branch and
then print

	no staged changes. Did you forget to 'git add'?

and then put you in an editor to write a commit message for an empty
commit. You're going to have to run 'git change' later, after making
the edits and running git add, so might as well delay editing of the
commit message until then. It will be easier to write the commit
message when there are actual concrete changes to describe. The
current editor pop-up is annoying.

We already avoid the editor pop-up when changing to a branch that has
a pending commit. This CL avoids it also for changing to a branch when
there's nothing staged.

Fixes golang/go#9278

Change-Id: I3f913a88527dc1a4f6a237cbb9e0f3b58f823eec
Reviewed-by: Chris Manghane <>
Reviewed-by: Andrew Gerrand <>
2 files changed
tree: e0aba3c255876de2f0243a190f3a519f5d125dfd
  2. git-review/