diff options
| author | Russ Cox <rsc@golang.org> | 2020-09-11 11:05:28 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2020-09-11 20:38:40 +0000 |
| commit | 0edcedeff807fefacf0249cdc78b5db4d956f514 (patch) | |
| tree | 75746bc6378f2a57d0365b8789d923d82faf4af3 | |
| parent | 3c482744cb56e16a5547cb048a12845d62497497 (diff) | |
| download | go-x-review-0edcedeff807fefacf0249cdc78b5db4d956f514.tar.xz | |
git-codereview: add mail -trust to set Trust+1 vote
The expectation is that approvers will change their .gitconfig
to define mail as codereview mail -trust.
For golang/go#40699.
Change-Id: I2a1040bf3f1c7248e9c361e1f2a83c17870b1df5
Reviewed-on: https://go-review.googlesource.com/c/review/+/254421
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
| -rw-r--r-- | git-codereview/mail.go | 9 | ||||
| -rw-r--r-- | git-codereview/submit.go | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/git-codereview/mail.go b/git-codereview/mail.go index 52ef44a..1fe35e5 100644 --- a/git-codereview/mail.go +++ b/git-codereview/mail.go @@ -21,6 +21,7 @@ func cmdMail(args []string) { wip = flags.Bool("wip", false, "set the status of a change to Work-in-Progress") topic = flags.String("topic", "", "set Gerrit topic") trybot = flags.Bool("trybot", false, "run trybots on the uploaded CLs") + trust = flags.Bool("trust", false, "add a Trust+1 vote to the CL") rList = new(stringList) // installed below ccList = new(stringList) // installed below tagList = new(stringList) // installed below @@ -31,7 +32,7 @@ func cmdMail(args []string) { flags.Var(tagList, "hashtag", "comma-separated list of tags to set") flags.Usage = func() { - fmt.Fprintf(stderr(), "Usage: %s mail %s [-r reviewer,...] [-cc mail,...] [-nokeycheck] [-topic topic] [-trybot] [-wip] [commit]\n", os.Args[0], globalFlags) + fmt.Fprintf(stderr(), "Usage: %s mail %s [-r reviewer,...] [-cc mail,...] [-f] [-diff] [-hashtag tag,...] [-nokeycheck] [-topic topic] [-trust] [-trybot] [-wip] [commit]\n", os.Args[0], globalFlags) } flags.Parse(args) if len(flags.Args()) > 1 { @@ -45,7 +46,7 @@ func cmdMail(args []string) { if len(flags.Args()) == 1 { c = b.CommitByRev("mail", flags.Arg(0)) } else { - c = b.DefaultCommit("mail", "must specify commit on command line or use mail HEAD for everything") + c = b.DefaultCommit("mail", "must specify commit on command line; use HEAD to mail all pending changes") } if *diff { @@ -133,6 +134,10 @@ func cmdMail(args []string) { refSpec += start + "topic=" + *topic start = "," } + if *trust { + refSpec += start + "l=Trust" + start = "," + } if *trybot { refSpec += start + "l=Run-TryBot" start = "," diff --git a/git-codereview/submit.go b/git-codereview/submit.go index bff713d..1f6f25f 100644 --- a/git-codereview/submit.go +++ b/git-codereview/submit.go @@ -99,7 +99,7 @@ func submit(b *Branch, c *Commit) *GerritChange { if c.Hash != g.CurrentRevision { run("git", "push", "-q", "origin", b.PushSpec(c)) - // Refetch change information, especially mergeable. + // Refetch change information. g, err = b.GerritChange(c, "LABELS", "CURRENT_REVISION") if err != nil { dief("%v", err) |
