blob: eef47fceaabcb9852e7995637c719f3a60f598da [file] [log] [blame]
Michael Ochmanne2d76a12016-06-23 17:07:37 +02001= gerrit review
Shawn O. Pearce92437a02009-08-28 20:30:26 -07002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
David Shevitzc47f2362018-09-27 10:55:35 -07004gerrit review - Apply reviews to one or more patch sets.
Shawn O. Pearce92437a02009-08-28 20:30:26 -07005
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02007[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08008--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02009_ssh_ -p <port> <host> _gerrit review_
Edwin Kempin73b26982012-07-16 13:53:22 +020010 [--project <PROJECT> | -p <PROJECT>]
David Pursehouse2ede20d2013-11-28 15:56:51 +090011 [--branch <BRANCH> | -b <BRANCH>]
Edwin Kempin73b26982012-07-16 13:53:22 +020012 [--message <MESSAGE> | -m <MESSAGE>]
Edwin Kempinb926a7c2013-11-24 07:42:29 +010013 [--notify <NOTIFYHANDLING> | -n <NOTIFYHANDLING>]
Edwin Kempin73b26982012-07-16 13:53:22 +020014 [--submit | -s]
Shawn O. Pearce47769242011-06-14 16:40:48 -070015 [--abandon | --restore]
Hugo Arès67b38e32014-08-21 16:07:39 -040016 [--rebase]
Orgad Shaneh8ad3ae52016-11-21 13:56:15 +020017 [--move <BRANCH>]
Mani Chandel42a7d2d2014-07-04 17:50:51 +053018 [--json | -j]
Shawn O. Pearce47769242011-06-14 16:40:48 -070019 [--verified <N>] [--code-review <N>]
Dave Borowitz55b290a2013-02-15 14:16:07 -080020 [--label Label-Name=<N>]
Dariusz Lukszac70e8622016-03-15 14:05:51 +010021 [--tag TAG]
darrien70a37842019-02-05 15:58:09 -050022 {COMMIT | CHANGENUMBER,PATCHSET}...
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080023--
Shawn O. Pearce92437a02009-08-28 20:30:26 -070024
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080025== DESCRIPTION
Shawn O. Pearce92437a02009-08-28 20:30:26 -070026Updates the current user's approval status of the specified patch
Martin Fick8c84ba32010-06-10 10:32:00 -060027sets and/or submits them for merging, sending out email
Dave Borowitzada289c2018-12-18 13:24:14 -080028notifications and updating code review metadata.
Shawn O. Pearce92437a02009-08-28 20:30:26 -070029
David Pursehouse6a0467f2013-11-28 12:16:43 +090030Patch sets may be specified in 'CHANGEID,PATCHSET' format, such as
31'8242,2', or 'COMMIT' format.
Shawn O. Pearce92437a02009-08-28 20:30:26 -070032
David Pursehouse6a0467f2013-11-28 12:16:43 +090033If a patch set is specified with the 'COMMIT' format, the complete
34or abbreviated commit SHA-1 may be used. If the same commit is available
35in multiple projects the `--project` option may be used to limit where
36Gerrit searches for the change to only the contents of the specified project.
David Pursehouse2ede20d2013-11-28 15:56:51 +090037If the same commit is available in multiple branches the `--branch` option
38may be used to limit where Gerrit searches for changes to only the specified
39branch.
David Pursehouse6a0467f2013-11-28 12:16:43 +090040
Shawn O. Pearce92437a02009-08-28 20:30:26 -070041
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080042== OPTIONS
Shawn O. Pearce92437a02009-08-28 20:30:26 -070043
Shawn O. Pearce47769242011-06-14 16:40:48 -070044--project::
Shawn O. Pearce92437a02009-08-28 20:30:26 -070045-p::
46 Name of the project the intended changes are contained
47 within. This option must be supplied before the commit
48 SHA-1 in order to take effect.
49
David Pursehouse2ede20d2013-11-28 15:56:51 +090050--branch::
51-b::
52 Name of the branch the intended changes are contained
53 within. This option must be supplied before the commit
54 SHA-1 in order to take effect.
55
Shawn O. Pearce47769242011-06-14 16:40:48 -070056--message::
Shawn O. Pearce92437a02009-08-28 20:30:26 -070057-m::
58 Optional cover letter to include as part of the message
59 sent to reviewers when the approval states are updated.
Hugo Arès5b800bb2014-08-22 09:51:58 -040060 (option is mutually exclusive with --json)
Shawn O. Pearce92437a02009-08-28 20:30:26 -070061
Mani Chandel42a7d2d2014-07-04 17:50:51 +053062--json::
63-j::
Saša Živkov031e4ba2017-06-12 12:47:12 +020064 Read review input json from stdin. See
Mani Chandel42a7d2d2014-07-04 17:50:51 +053065 link:rest-api-changes.html#review-input[ReviewInput] entity for the
66 format.
David Pursehouse05bd48c2019-04-19 13:58:21 +090067 (option is mutually exclusive with --submit, --restore,
Orgad Shaneh8ad3ae52016-11-21 13:56:15 +020068 --abandon, --message, --rebase and --move)
Mani Chandel42a7d2d2014-07-04 17:50:51 +053069
Edwin Kempinb926a7c2013-11-24 07:42:29 +010070--notify::
71-n::
72 Who to send email notifications to after the review is stored.
73 This option only applies for storing the review, but not for any
74 other action (abandon, restore etc.) done by this command.
75+
76* NONE: send no email
77* OWNER: send email to change owners
78* OWNER_REVIEWERS: send email to change owners and reviewers
79* ALL: send email to all (change owners, reviewers, watchers and any
80 user who has starred the change)
81
Shawn O. Pearce47769242011-06-14 16:40:48 -070082--help::
Shawn O. Pearce92437a02009-08-28 20:30:26 -070083-h::
84 Display site-specific usage information, including the
85 complete listing of supported approval categories and values.
86
Shawn O. Pearce47769242011-06-14 16:40:48 -070087--abandon::
David Pursehouse58619542012-06-27 16:37:40 +090088 Abandon the specified change(s).
David Pursehouse05bd48c2019-04-19 13:58:21 +090089 (option is mutually exclusive with --submit, --restore,
Orgad Shaneh8ad3ae52016-11-21 13:56:15 +020090 --rebase, --move and --json)
Martin Fick30f823c2010-10-05 14:39:51 -060091
Shawn O. Pearce47769242011-06-14 16:40:48 -070092--restore::
David Pursehouse58619542012-06-27 16:37:40 +090093 Restore the specified abandoned change(s).
Hugo Arès5b800bb2014-08-22 09:51:58 -040094 (option is mutually exclusive with --abandon and --json)
Martin Fick30f823c2010-10-05 14:39:51 -060095
Hugo Arès67b38e32014-08-21 16:07:39 -040096--rebase::
97 Rebase the specified change(s).
David Pursehouse05bd48c2019-04-19 13:58:21 +090098 (option is mutually exclusive with --abandon, --submit and --json)
Hugo Arès67b38e32014-08-21 16:07:39 -040099
Orgad Shaneh8ad3ae52016-11-21 13:56:15 +0200100--move::
101 Move the specified change(s).
102 (option is mutually exclusive with --json and --abandon)
103
Shawn O. Pearce47769242011-06-14 16:40:48 -0700104--submit::
Martin Fick8c84ba32010-06-10 10:32:00 -0600105-s::
106 Submit the specified patch set(s) for merging.
David Pursehouse05bd48c2019-04-19 13:58:21 +0900107 (option is mutually exclusive with --abandon, --rebase
Hugo Arès67b38e32014-08-21 16:07:39 -0400108 and --json)
Martin Fick8c84ba32010-06-10 10:32:00 -0600109
Shawn O. Pearce47769242011-06-14 16:40:48 -0700110--code-review::
111--verified::
Edwin Kempin4fc7ab22013-11-16 07:12:27 +0100112 Set the label to the value 'N'. The exact option names
113 supported and the range of values permitted differs per site,
114 check the output of --help, or contact your site administrator
115 for further details. These options are only available for the
116 labels that are defined in the 'All-Projects' root project and
117 that are valid for all projects; for other labels, see --label.
Edwin Kempin5a6edb12013-11-16 07:21:13 +0100118 Votes that are not permitted for the user are silently ignored.
Dave Borowitz55b290a2013-02-15 14:16:07 -0800119
120--label::
Changcheng Xiao9ff64a62017-07-17 15:00:34 +0200121 Set a label by name to the value 'N'. The ability to vote on all specified
122 labels is required. If the vote is invalid (invalid label or invalid name),
123 the vote is not permitted for the user, or the vote is on an outdated or
124 closed patch set, return an error instead of silently discarding the vote.
Nasser Grainawib86ae492015-11-11 16:29:38 -0800125
Dariusz Lukszac70e8622016-03-15 14:05:51 +0100126--tag::
127-t::
Sven Selbergfca464c2018-09-28 12:36:15 +0200128 Apply a 'TAG' to the change message, votes, and inline comments. The 'TAG'
129 can represent an external system like CI that does automated verification
David Pursehouse54f821f2018-09-28 20:15:01 +0900130 of the change. Comments that contain TAG values with 'autogenerated:' prefix
131 can be filtered out in the web UI.
Sven Selbergfca464c2018-09-28 12:36:15 +0200132 Note that to apply different tags on different votes/comments, multiple
133 invocations of the SSH command are required.
Dariusz Lukszac70e8622016-03-15 14:05:51 +0100134
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800135== ACCESS
Gert van Dijkdc4f8d12017-08-27 21:14:23 +0200136Any user who has SSH access to Gerrit.
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700137
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800138== SCRIPTING
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700139This command is intended to be used in scripts.
140
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800141== EXAMPLES
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700142
143Approve the change with commit c0ff33 as "Verified +1"
Michael Ochmannb99feab2016-07-06 14:10:22 +0200144----
darrien70a37842019-02-05 15:58:09 -0500145$ ssh -p 29418 review.example.com gerrit review --verified +1 8242,2
Michael Ochmannb99feab2016-07-06 14:10:22 +0200146----
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700147
David Pursehouseaa9acce3e2019-02-06 08:46:54 +0900148Approve the change with change number 8242 and patch set 2 as "Code-Review +2"
149----
Luca Milanesio1ff28f32019-02-07 23:36:29 +0000150$ ssh -p 29418 review.example.com gerrit review --code-review +2 8242,2
David Pursehouseaa9acce3e2019-02-06 08:46:54 +0900151----
152
Edwin Kempin397b13a2013-11-16 07:25:46 +0100153Vote on the project specific label "mylabel":
Michael Ochmannb99feab2016-07-06 14:10:22 +0200154----
darrien70a37842019-02-05 15:58:09 -0500155$ ssh -p 29418 review.example.com gerrit review --label mylabel=+1 8242,2
Michael Ochmannb99feab2016-07-06 14:10:22 +0200156----
Edwin Kempin397b13a2013-11-16 07:25:46 +0100157
Shawn O. Pearce9c0cfc22011-04-04 21:50:04 -0400158Append the message "Build Successful". Notice two levels of quoting is
159required, one for the local shell, and another for the argument parser
160inside the Gerrit server:
Michael Ochmannb99feab2016-07-06 14:10:22 +0200161----
darrien70a37842019-02-05 15:58:09 -0500162$ ssh -p 29418 review.example.com gerrit review -m '"Build Successful"' 8242,2
Michael Ochmannb99feab2016-07-06 14:10:22 +0200163----
Shawn O. Pearce9c0cfc22011-04-04 21:50:04 -0400164
Dave Borowitz01c1b1f2013-02-27 13:49:04 -0800165Mark the unmerged commits both "Verified +1" and "Code-Review +2" and
Martin Fick8c84ba32010-06-10 10:32:00 -0600166submit them for merging:
Michael Ochmannb99feab2016-07-06 14:10:22 +0200167----
David Shevitzc47f2362018-09-27 10:55:35 -0700168$ ssh -p 29418 review.example.com gerrit review \
169 --verified +1 \
170 --code-review +2 \
171 --submit \
172 --project this/project \
173 $(git rev-list origin/master..HEAD)
Michael Ochmannb99feab2016-07-06 14:10:22 +0200174----
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700175
Fredrik Luthanderdee599a2011-11-03 13:30:27 +0100176Abandon an active change:
Michael Ochmannb99feab2016-07-06 14:10:22 +0200177----
darrien70a37842019-02-05 15:58:09 -0500178$ ssh -p 29418 review.example.com gerrit review --abandon 8242,2
Michael Ochmannb99feab2016-07-06 14:10:22 +0200179----
Fredrik Luthanderdee599a2011-11-03 13:30:27 +0100180
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800181== SEE ALSO
Shawn O. Pearce92437a02009-08-28 20:30:26 -0700182
183* link:access-control.html[Access Controls]
184
185GERRIT
186------
187Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700188
189SEARCHBOX
190---------