aboutsummaryrefslogtreecommitdiff
path: root/git-codereview/mail.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-02-05 11:19:05 -0500
committerAustin Clements <austin@google.com>2016-02-05 19:55:13 +0000
commit36fe892ba0a999ea6698a694caf1bdec9ba2417b (patch)
tree922b39e9b4ec6e2d3edb6d5137ce1ede6f924e51 /git-codereview/mail.go
parenta8389558ab17f14c5ab75fbdec70e3814a42f09f (diff)
downloadgo-x-review-36fe892ba0a999ea6698a694caf1bdec9ba2417b.tar.xz
git-codereview: accept any commit spelling for mail and submit
Currently the mail and submit subcommands only accept commit hashes. This makes them inconsistent with other git commands (git is hard enough without having to remember another convention) and makes working with multi-commit branches cumbersome. Change mail and submit to accept any standard commit spelling. In particular, this makes it possible to use HEAD-relative names: "git mail HEAD" sends the whole current branch. We still require that the named commit be pending on the current branch to avoid accidentally naming a completely unrelated commit. Change-Id: If84d315e0fc32118a5283adfbca7a3b56f3c098c Reviewed-on: https://go-review.googlesource.com/19271 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'git-codereview/mail.go')
-rw-r--r--git-codereview/mail.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-codereview/mail.go b/git-codereview/mail.go
index 0354836..c83a5d8 100644
--- a/git-codereview/mail.go
+++ b/git-codereview/mail.go
@@ -25,7 +25,7 @@ func cmdMail(args []string) {
flags.Var(ccList, "cc", "comma-separated list of people to CC:")
flags.Usage = func() {
- fmt.Fprintf(stderr(), "Usage: %s mail %s [-r reviewer,...] [-cc mail,...] [-topic topic] [-trybot] [commit-hash]\n", os.Args[0], globalFlags)
+ fmt.Fprintf(stderr(), "Usage: %s mail %s [-r reviewer,...] [-cc mail,...] [-topic topic] [-trybot] [commit]\n", os.Args[0], globalFlags)
}
flags.Parse(args)
if len(flags.Args()) > 1 {
@@ -37,7 +37,7 @@ func cmdMail(args []string) {
var c *Commit
if len(flags.Args()) == 1 {
- c = b.CommitByHash("mail", flags.Arg(0))
+ c = b.CommitByRev("mail", flags.Arg(0))
} else {
c = b.DefaultCommit("mail")
}