git-codereview: document short names in mail command
While we're here, fix bug in git-codereview gofmt usage message.
Change-Id: I547b8ae6fab01db1bc6b44b0e706d8faadbb60a9
Reviewed-on: https://go-review.googlesource.com/2781
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/git-codereview/doc.go b/git-codereview/doc.go
index 8f57107..566b82a 100644
--- a/git-codereview/doc.go
+++ b/git-codereview/doc.go
@@ -8,7 +8,9 @@
The git-codereview tool manages "change branches" in the local git repository.
Each such branch tracks a single commit, or "pending change",
-that is reviewed using a Gerrit server.
+that is reviewed using a Gerrit server; the Gerrit remote must be
+named 'origin' in the local git repo.
+
Modifications to the pending change are applied by amending the commit.
This process implements the "single-commit feature branch" model.
@@ -122,10 +124,13 @@
review and to be CC'ed about the code review.
Multiple addresses are given as a comma-separated list.
-The mail command fails if there are staged changes that are not committed. The
--f flag overrides this behavior.
+An email address passed to -r or -cc can be shortened from name@domain to name.
+The mail command resolves such shortenings by reading the list of past reviewers
+from the git repository log to find email addresses of the form name@somedomain
+and then, in case of ambiguity, using the reviewer who appears most often.
-The mail command assumes that the Gerrit remote is called 'origin'.
+The mail command fails if there are staged changes that are not committed.
+The -f flag overrides this behavior.
The mail command updates the tag <branchname>.mailed to refer to the
commit that was most recently mailed, so running 'git diff <branchname>.mailed'
diff --git a/git-codereview/gofmt.go b/git-codereview/gofmt.go
index 93da314..f9644a0 100644
--- a/git-codereview/gofmt.go
+++ b/git-codereview/gofmt.go
@@ -21,7 +21,7 @@
flags.BoolVar(&gofmtList, "l", false, "list files that need to be formatted")
flags.Parse(args)
if len(flag.Args()) > 0 {
- fmt.Fprintf(stderr(), "Usage: %s gofmt %s [-l]\n", globalFlags, os.Args[0])
+ fmt.Fprintf(stderr(), "Usage: %s gofmt %s [-l]\n", os.Args[0], globalFlags)
os.Exit(2)
}