diff options
| author | Russ Cox <rsc@golang.org> | 2021-01-07 12:26:06 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-01-13 14:40:05 +0000 |
| commit | fdc5e6a4e6b93c6381d20cf1dfbfaa49f420a43d (patch) | |
| tree | 50b026373387e0ea57d83ac46e80d27a906a13de /git-codereview/review.go | |
| parent | 4aa052da7f65ad6eeb77cce14ef70dac82d242cc (diff) | |
| download | go-x-review-fdc5e6a4e6b93c6381d20cf1dfbfaa49f420a43d.tar.xz | |
git-codereview: add reword command
Quoting the new docs:
The reword command edits pending commit messages.
git codereview reword [commit...]
Reword opens the editor on the commit message for each named commit in turn.
When all the editing is finished, it applies the changes to the pending
commits. If no commit is listed, reword applies to the most recent pending
commit.
Reword is similar in effect to running “git codereview rebase-work” and
changing the script action for the named commits to “reword”, or (with no
arguments) to “git commit --amend”, but it only affects the commit messages,
not the state of the git staged index, nor any checked-out files. This more
careful implementation makes it safe to use when there are local changes or,
for example, when tests are running that would be broken by temporary
changes to the checked-out tree, as would happen during “git codereview
rebase-work”.
Change-Id: I38ac939b8530bf237c6cafb911f2b17d22eaca60
Reviewed-on: https://go-review.googlesource.com/c/review/+/279718
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'git-codereview/review.go')
| -rw-r--r-- | git-codereview/review.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-codereview/review.go b/git-codereview/review.go index 5c7f16d..6dcb6a0 100644 --- a/git-codereview/review.go +++ b/git-codereview/review.go @@ -33,6 +33,7 @@ func initFlags() { flags = flag.NewFlagSet("", flag.ExitOnError) flags.Usage = func() { fmt.Fprintf(stderr(), usage, progName, progName) + exit(2) } flags.SetOutput(stderr()) flags.BoolVar(noRun, "n", false, "print but do not run commands") @@ -65,6 +66,7 @@ Available commands: mail [-r reviewer,...] [-cc mail,...] [options] [commit] pending [-c] [-l] [-s] rebase-work + reword [commit...] submit [-i | commit...] sync sync-branch [-continue] @@ -109,6 +111,8 @@ func main() { cmd = cmdPending case "rebase-work": cmd = cmdRebaseWork + case "reword": + cmd = cmdReword case "submit": cmd = cmdSubmit case "sync": |
