Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 1 | = gerrit review |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 2 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3 | == NAME |
David Shevitz | c47f236 | 2018-09-27 10:55:35 -0700 | [diff] [blame] | 4 | gerrit review - Apply reviews to one or more patch sets. |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 5 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6 | == SYNOPSIS |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 7 | [verse] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 8 | -- |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 9 | _ssh_ -p <port> <host> _gerrit review_ |
Edwin Kempin | 73b2698 | 2012-07-16 13:53:22 +0200 | [diff] [blame] | 10 | [--project <PROJECT> | -p <PROJECT>] |
David Pursehouse | 2ede20d | 2013-11-28 15:56:51 +0900 | [diff] [blame] | 11 | [--branch <BRANCH> | -b <BRANCH>] |
Edwin Kempin | 73b2698 | 2012-07-16 13:53:22 +0200 | [diff] [blame] | 12 | [--message <MESSAGE> | -m <MESSAGE>] |
Edwin Kempin | b926a7c | 2013-11-24 07:42:29 +0100 | [diff] [blame] | 13 | [--notify <NOTIFYHANDLING> | -n <NOTIFYHANDLING>] |
Edwin Kempin | 73b2698 | 2012-07-16 13:53:22 +0200 | [diff] [blame] | 14 | [--submit | -s] |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 15 | [--abandon | --restore] |
Hugo Arès | 67b38e3 | 2014-08-21 16:07:39 -0400 | [diff] [blame] | 16 | [--rebase] |
Orgad Shaneh | 8ad3ae5 | 2016-11-21 13:56:15 +0200 | [diff] [blame] | 17 | [--move <BRANCH>] |
Mani Chandel | 42a7d2d | 2014-07-04 17:50:51 +0530 | [diff] [blame] | 18 | [--json | -j] |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 19 | [--verified <N>] [--code-review <N>] |
Dave Borowitz | 55b290a | 2013-02-15 14:16:07 -0800 | [diff] [blame] | 20 | [--label Label-Name=<N>] |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 21 | [--tag TAG] |
darrien | 70a3784 | 2019-02-05 15:58:09 -0500 | [diff] [blame] | 22 | {COMMIT | CHANGENUMBER,PATCHSET}... |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 23 | -- |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 24 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 25 | == DESCRIPTION |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 26 | Updates the current user's approval status of the specified patch |
Martin Fick | 8c84ba3 | 2010-06-10 10:32:00 -0600 | [diff] [blame] | 27 | sets and/or submits them for merging, sending out email |
Dave Borowitz | ada289c | 2018-12-18 13:24:14 -0800 | [diff] [blame] | 28 | notifications and updating code review metadata. |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 29 | |
David Pursehouse | 6a0467f | 2013-11-28 12:16:43 +0900 | [diff] [blame] | 30 | Patch sets may be specified in 'CHANGEID,PATCHSET' format, such as |
| 31 | '8242,2', or 'COMMIT' format. |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 32 | |
David Pursehouse | 6a0467f | 2013-11-28 12:16:43 +0900 | [diff] [blame] | 33 | If a patch set is specified with the 'COMMIT' format, the complete |
| 34 | or abbreviated commit SHA-1 may be used. If the same commit is available |
| 35 | in multiple projects the `--project` option may be used to limit where |
| 36 | Gerrit searches for the change to only the contents of the specified project. |
David Pursehouse | 2ede20d | 2013-11-28 15:56:51 +0900 | [diff] [blame] | 37 | If the same commit is available in multiple branches the `--branch` option |
| 38 | may be used to limit where Gerrit searches for changes to only the specified |
| 39 | branch. |
David Pursehouse | 6a0467f | 2013-11-28 12:16:43 +0900 | [diff] [blame] | 40 | |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 41 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 42 | == OPTIONS |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 43 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 44 | --project:: |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 45 | -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 Pursehouse | 2ede20d | 2013-11-28 15:56:51 +0900 | [diff] [blame] | 50 | --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. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 56 | --message:: |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 57 | -m:: |
| 58 | Optional cover letter to include as part of the message |
| 59 | sent to reviewers when the approval states are updated. |
Hugo Arès | 5b800bb | 2014-08-22 09:51:58 -0400 | [diff] [blame] | 60 | (option is mutually exclusive with --json) |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 61 | |
Mani Chandel | 42a7d2d | 2014-07-04 17:50:51 +0530 | [diff] [blame] | 62 | --json:: |
| 63 | -j:: |
Saša Živkov | 031e4ba | 2017-06-12 12:47:12 +0200 | [diff] [blame] | 64 | Read review input json from stdin. See |
Mani Chandel | 42a7d2d | 2014-07-04 17:50:51 +0530 | [diff] [blame] | 65 | link:rest-api-changes.html#review-input[ReviewInput] entity for the |
| 66 | format. |
David Pursehouse | 05bd48c | 2019-04-19 13:58:21 +0900 | [diff] [blame] | 67 | (option is mutually exclusive with --submit, --restore, |
Orgad Shaneh | 8ad3ae5 | 2016-11-21 13:56:15 +0200 | [diff] [blame] | 68 | --abandon, --message, --rebase and --move) |
Mani Chandel | 42a7d2d | 2014-07-04 17:50:51 +0530 | [diff] [blame] | 69 | |
Edwin Kempin | b926a7c | 2013-11-24 07:42:29 +0100 | [diff] [blame] | 70 | --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. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 82 | --help:: |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 83 | -h:: |
| 84 | Display site-specific usage information, including the |
| 85 | complete listing of supported approval categories and values. |
| 86 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 87 | --abandon:: |
David Pursehouse | 5861954 | 2012-06-27 16:37:40 +0900 | [diff] [blame] | 88 | Abandon the specified change(s). |
David Pursehouse | 05bd48c | 2019-04-19 13:58:21 +0900 | [diff] [blame] | 89 | (option is mutually exclusive with --submit, --restore, |
Orgad Shaneh | 8ad3ae5 | 2016-11-21 13:56:15 +0200 | [diff] [blame] | 90 | --rebase, --move and --json) |
Martin Fick | 30f823c | 2010-10-05 14:39:51 -0600 | [diff] [blame] | 91 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 92 | --restore:: |
David Pursehouse | 5861954 | 2012-06-27 16:37:40 +0900 | [diff] [blame] | 93 | Restore the specified abandoned change(s). |
Hugo Arès | 5b800bb | 2014-08-22 09:51:58 -0400 | [diff] [blame] | 94 | (option is mutually exclusive with --abandon and --json) |
Martin Fick | 30f823c | 2010-10-05 14:39:51 -0600 | [diff] [blame] | 95 | |
Hugo Arès | 67b38e3 | 2014-08-21 16:07:39 -0400 | [diff] [blame] | 96 | --rebase:: |
| 97 | Rebase the specified change(s). |
David Pursehouse | 05bd48c | 2019-04-19 13:58:21 +0900 | [diff] [blame] | 98 | (option is mutually exclusive with --abandon, --submit and --json) |
Hugo Arès | 67b38e3 | 2014-08-21 16:07:39 -0400 | [diff] [blame] | 99 | |
Orgad Shaneh | 8ad3ae5 | 2016-11-21 13:56:15 +0200 | [diff] [blame] | 100 | --move:: |
| 101 | Move the specified change(s). |
| 102 | (option is mutually exclusive with --json and --abandon) |
| 103 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 104 | --submit:: |
Martin Fick | 8c84ba3 | 2010-06-10 10:32:00 -0600 | [diff] [blame] | 105 | -s:: |
| 106 | Submit the specified patch set(s) for merging. |
David Pursehouse | 05bd48c | 2019-04-19 13:58:21 +0900 | [diff] [blame] | 107 | (option is mutually exclusive with --abandon, --rebase |
Hugo Arès | 67b38e3 | 2014-08-21 16:07:39 -0400 | [diff] [blame] | 108 | and --json) |
Martin Fick | 8c84ba3 | 2010-06-10 10:32:00 -0600 | [diff] [blame] | 109 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 110 | --code-review:: |
| 111 | --verified:: |
Edwin Kempin | 4fc7ab2 | 2013-11-16 07:12:27 +0100 | [diff] [blame] | 112 | 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 Kempin | 5a6edb1 | 2013-11-16 07:21:13 +0100 | [diff] [blame] | 118 | Votes that are not permitted for the user are silently ignored. |
Dave Borowitz | 55b290a | 2013-02-15 14:16:07 -0800 | [diff] [blame] | 119 | |
| 120 | --label:: |
Changcheng Xiao | 9ff64a6 | 2017-07-17 15:00:34 +0200 | [diff] [blame] | 121 | 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 Grainawi | b86ae49 | 2015-11-11 16:29:38 -0800 | [diff] [blame] | 125 | |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 126 | --tag:: |
| 127 | -t:: |
Sven Selberg | fca464c | 2018-09-28 12:36:15 +0200 | [diff] [blame] | 128 | 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 Pursehouse | 54f821f | 2018-09-28 20:15:01 +0900 | [diff] [blame] | 130 | of the change. Comments that contain TAG values with 'autogenerated:' prefix |
| 131 | can be filtered out in the web UI. |
Sven Selberg | fca464c | 2018-09-28 12:36:15 +0200 | [diff] [blame] | 132 | Note that to apply different tags on different votes/comments, multiple |
| 133 | invocations of the SSH command are required. |
Dariusz Luksza | c70e862 | 2016-03-15 14:05:51 +0100 | [diff] [blame] | 134 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 135 | == ACCESS |
Gert van Dijk | dc4f8d1 | 2017-08-27 21:14:23 +0200 | [diff] [blame] | 136 | Any user who has SSH access to Gerrit. |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 137 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 138 | == SCRIPTING |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 139 | This command is intended to be used in scripts. |
| 140 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 141 | == EXAMPLES |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 142 | |
| 143 | Approve the change with commit c0ff33 as "Verified +1" |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 144 | ---- |
darrien | 70a3784 | 2019-02-05 15:58:09 -0500 | [diff] [blame] | 145 | $ ssh -p 29418 review.example.com gerrit review --verified +1 8242,2 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 146 | ---- |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 147 | |
David Pursehouse | aa9acce3e | 2019-02-06 08:46:54 +0900 | [diff] [blame] | 148 | Approve the change with change number 8242 and patch set 2 as "Code-Review +2" |
| 149 | ---- |
Luca Milanesio | 1ff28f3 | 2019-02-07 23:36:29 +0000 | [diff] [blame] | 150 | $ ssh -p 29418 review.example.com gerrit review --code-review +2 8242,2 |
David Pursehouse | aa9acce3e | 2019-02-06 08:46:54 +0900 | [diff] [blame] | 151 | ---- |
| 152 | |
Edwin Kempin | 397b13a | 2013-11-16 07:25:46 +0100 | [diff] [blame] | 153 | Vote on the project specific label "mylabel": |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 154 | ---- |
darrien | 70a3784 | 2019-02-05 15:58:09 -0500 | [diff] [blame] | 155 | $ ssh -p 29418 review.example.com gerrit review --label mylabel=+1 8242,2 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 156 | ---- |
Edwin Kempin | 397b13a | 2013-11-16 07:25:46 +0100 | [diff] [blame] | 157 | |
Shawn O. Pearce | 9c0cfc2 | 2011-04-04 21:50:04 -0400 | [diff] [blame] | 158 | Append the message "Build Successful". Notice two levels of quoting is |
| 159 | required, one for the local shell, and another for the argument parser |
| 160 | inside the Gerrit server: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 161 | ---- |
darrien | 70a3784 | 2019-02-05 15:58:09 -0500 | [diff] [blame] | 162 | $ ssh -p 29418 review.example.com gerrit review -m '"Build Successful"' 8242,2 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 163 | ---- |
Shawn O. Pearce | 9c0cfc2 | 2011-04-04 21:50:04 -0400 | [diff] [blame] | 164 | |
Dave Borowitz | 01c1b1f | 2013-02-27 13:49:04 -0800 | [diff] [blame] | 165 | Mark the unmerged commits both "Verified +1" and "Code-Review +2" and |
Martin Fick | 8c84ba3 | 2010-06-10 10:32:00 -0600 | [diff] [blame] | 166 | submit them for merging: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 167 | ---- |
David Shevitz | c47f236 | 2018-09-27 10:55:35 -0700 | [diff] [blame] | 168 | $ 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 Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 174 | ---- |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 175 | |
Fredrik Luthander | dee599a | 2011-11-03 13:30:27 +0100 | [diff] [blame] | 176 | Abandon an active change: |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 177 | ---- |
darrien | 70a3784 | 2019-02-05 15:58:09 -0500 | [diff] [blame] | 178 | $ ssh -p 29418 review.example.com gerrit review --abandon 8242,2 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 179 | ---- |
Fredrik Luthander | dee599a | 2011-11-03 13:30:27 +0100 | [diff] [blame] | 180 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 181 | == SEE ALSO |
Shawn O. Pearce | 92437a0 | 2009-08-28 20:30:26 -0700 | [diff] [blame] | 182 | |
| 183 | * link:access-control.html[Access Controls] |
| 184 | |
| 185 | GERRIT |
| 186 | ------ |
| 187 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 188 | |
| 189 | SEARCHBOX |
| 190 | --------- |