blob: 5108dda6e1463bb818ef0badd1344d8505d5afa8 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /changes/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the change related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007[[change-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Change Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +01009
David Ostrovsky837c0ee2014-04-27 12:54:20 +020010[[create-change]]
11=== Create Change
12--
13'POST /changes'
14--
15
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -080016The change input link:#change-input[ChangeInput] entity must be provided in the
17request body.
David Ostrovsky837c0ee2014-04-27 12:54:20 +020018
19.Request
20----
21 POST /changes HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090022 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020023
24 {
25 "project" : "myProject",
26 "subject" : "Let's support 100% Gerrit workflow direct in browser",
27 "branch" : "master",
28 "topic" : "create-change-in-browser",
29 "status" : "DRAFT"
30 }
31----
32
33As response a link:#change-info[ChangeInfo] entity is returned that describes
34the resulting change.
35
36.Response
37----
38 HTTP/1.1 200 OK
39 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090040 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020041
42 )]}'
43 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020044 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
45 "project": "myProject",
46 "branch": "master",
47 "topic": "create-change-in-browser",
48 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
49 "subject": "Let's support 100% Gerrit workflow direct in browser",
50 "status": "DRAFT",
51 "created": "2014-05-05 07:15:44.639000000",
52 "updated": "2014-05-05 07:15:44.639000000",
53 "mergeable": true,
54 "insertions": 0,
55 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020056 "_number": 4711,
57 "owner": {
58 "name": "John Doe"
59 }
60 }
61----
62
Edwin Kempin76202742013-02-15 13:51:50 +010063[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080064=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080065--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010066'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080067--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010068
Saša Živkovdd804022014-06-23 16:44:03 +020069Queries changes visible to the caller. The
70link:user-search.html#_search_operators[query string] must be provided
71by the `q` parameter. The `n` parameter can be used to limit the
72returned results.
Edwin Kempind0a63922013-01-23 16:32:59 +010073
Edwin Kempine3446292013-02-19 16:40:14 +010074As result a list of link:#change-info[ChangeInfo] entries is returned.
75The change output is sorted by the last update time, most recently
76updated to oldest updated.
77
Edwin Kempind0a63922013-01-23 16:32:59 +010078Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010079
80.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010081----
Edwin Kempin2091edb2013-01-23 19:07:38 +010082 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010083----
Edwin Kempind0a63922013-01-23 16:32:59 +010084
Edwin Kempin37440832013-02-06 11:36:00 +010085.Response
86----
Edwin Kempind0a63922013-01-23 16:32:59 +010087 HTTP/1.1 200 OK
88 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090089 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010090
91 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050092 [
93 {
John Spurlockd25fad12013-03-09 11:48:49 -050094 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
95 "project": "demo",
96 "branch": "master",
97 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
98 "subject": "One change",
99 "status": "NEW",
100 "created": "2012-07-17 07:18:30.854000000",
101 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500102 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100103 "insertions": 26,
104 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500105 "_number": 1756,
106 "owner": {
107 "name": "John Doe"
108 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100109 },
John Spurlockd25fad12013-03-09 11:48:49 -0500110 {
John Spurlockd25fad12013-03-09 11:48:49 -0500111 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
112 "project": "demo",
113 "branch": "master",
114 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
115 "subject": "Another change",
116 "status": "NEW",
117 "created": "2012-07-17 07:18:30.884000000",
118 "updated": "2012-07-17 07:18:30.885000000",
119 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100120 "insertions": 12,
121 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500122 "_number": 1757,
123 "owner": {
124 "name": "John Doe"
125 },
126 "_more_changes": true
127 }
128 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100129----
130
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100131If the number of changes matching the query exceeds either the internal
132limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900133`_more_changes: true` JSON field set.
134
135The `S` or `start` query parameter can be supplied to skip a number
136of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100137
138Clients are allowed to specify more than one query by setting the `q`
139parameter multiple times. In this case the result is an array of
140arrays, one per query in the same order the queries were given in.
141
Edwin Kempina64c4b92013-01-23 11:30:40 +0100142.Query for the 25 most recent open changes of the projects that you watch
143****
144get::/changes/?q=status:open+is:watched&n=25
145****
146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100148
149.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100150----
151 GET /changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100152----
Edwin Kempind0a63922013-01-23 16:32:59 +0100153
Edwin Kempin37440832013-02-06 11:36:00 +0100154.Response
155----
Edwin Kempind0a63922013-01-23 16:32:59 +0100156 HTTP/1.1 200 OK
157 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900158 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100159
160 )]}'
161 [
162 [
163 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100164 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
165 "project": "demo",
166 "branch": "master",
167 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
168 "subject": "One change",
169 "status": "NEW",
170 "created": "2012-07-17 07:18:30.854000000",
171 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100172 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100173 "insertions": 4,
174 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100175 "_number": 1756,
176 "owner": {
177 "name": "John Doe"
178 },
179 "labels": {
180 "Verified": {},
181 "Code-Review": {}
182 }
183 }
184 ],
185 [],
186 []
187 ]
188----
189
Edwin Kempina64c4b92013-01-23 11:30:40 +0100190.Query the changes for your user dashboard
191****
192get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
193****
194
Edwin Kempind0a63922013-01-23 16:32:59 +0100195Additional fields can be obtained by adding `o` parameters, each
196option requires more database lookups and slows down the query
197response time to the client so they are generally disabled by
198default. Optional fields are:
199
Edwin Kempine3446292013-02-19 16:40:14 +0100200[[labels]]
201--
Edwin Kempind0a63922013-01-23 16:32:59 +0100202* `LABELS`: a summary of each label required for submit, and
203 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100204--
Edwin Kempind0a63922013-01-23 16:32:59 +0100205
Edwin Kempine3446292013-02-19 16:40:14 +0100206[[detailed-labels]]
207--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800208* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800209 values of all existing approvals, recognized label values, values
Edwin Kempin66af3d82015-11-10 17:38:40 -0800210 permitted to be set by the current user, all reviewers by state, and
211 reviewers that may be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100212--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800213
Edwin Kempine3446292013-02-19 16:40:14 +0100214[[current-revision]]
215--
Edwin Kempind0a63922013-01-23 16:32:59 +0100216* `CURRENT_REVISION`: describe the current revision (patch set)
217 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100218--
Edwin Kempind0a63922013-01-23 16:32:59 +0100219
Edwin Kempine3446292013-02-19 16:40:14 +0100220[[all-revisions]]
221--
Edwin Kempind0a63922013-01-23 16:32:59 +0100222* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100223--
Edwin Kempind0a63922013-01-23 16:32:59 +0100224
David Pursehouse025c1af2015-11-20 17:02:50 +0900225[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200226--
227* `DOWNLOAD_COMMANDS`: include the `commands` field in the
228 link:#fetch-info[FetchInfo] for revisions. Only valid when the
229 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
230--
231
Edwin Kempine3446292013-02-19 16:40:14 +0100232[[current-commit]]
233--
Edwin Kempind0a63922013-01-23 16:32:59 +0100234* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900235 commit object, including message. Only valid when the
236 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100237--
Edwin Kempind0a63922013-01-23 16:32:59 +0100238
Edwin Kempine3446292013-02-19 16:40:14 +0100239[[all-commits]]
240--
Edwin Kempind0a63922013-01-23 16:32:59 +0100241* `ALL_COMMITS`: parse and output all header fields from the
242 output revisions. If only `CURRENT_REVISION` was requested
243 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100244--
Edwin Kempind0a63922013-01-23 16:32:59 +0100245
Edwin Kempine3446292013-02-19 16:40:14 +0100246[[current-files]]
247--
Edwin Kempind0a63922013-01-23 16:32:59 +0100248* `CURRENT_FILES`: list files modified by the commit, including
249 basic line counts inserted/deleted per file. Only valid when
David Pursehouse98006e82013-10-02 10:15:52 +0900250 the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100251--
Edwin Kempind0a63922013-01-23 16:32:59 +0100252
Edwin Kempine3446292013-02-19 16:40:14 +0100253[[all-files]]
254--
Edwin Kempind0a63922013-01-23 16:32:59 +0100255* `ALL_FILES`: list files modified by the commit, including
256 basic line counts inserted/deleted per file. If only the
David Pursehouse98006e82013-10-02 10:15:52 +0900257 `CURRENT_REVISION` was requested then only that commit's
Edwin Kempind0a63922013-01-23 16:32:59 +0100258 modified files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100259--
Edwin Kempind0a63922013-01-23 16:32:59 +0100260
Edwin Kempine3446292013-02-19 16:40:14 +0100261[[detailed-accounts]]
262--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200263* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
264 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100265--
Dave Borowitz8926a882013-02-01 14:32:48 -0800266
John Spurlock74a70cc2013-03-23 16:41:50 -0400267[[messages]]
268--
269* `MESSAGES`: include messages associated with the change.
270--
271
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700272[[actions]]
273--
274* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800275 for the change and its current revision. Ignored if the caller
276 is not authenticated.
277--
278
279[[change-actions]]
280--
281* `CHANGE_ACTIONS`: include information on available
282 change actions for the change. Ignored if the caller
283 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700284--
285
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700286[[reviewed]]
287--
Dave Borowitz86669b32015-05-27 14:56:10 -0700288* `REVIEWED`: include the `reviewed` field if all of the following are
289 true:
290 * the change is open
291 * the caller is authenticated
292 * the caller has commented on the change more recently than the last update
293 from the change owner, i.e. this change would show up in the results of
294 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700295--
296
Khai Do2a23ec82014-09-19 16:33:02 -0700297[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100298--
Sven Selbergd26bd542014-11-21 16:28:10 +0100299* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
300 therefore only valid in combination with `CURRENT_COMMIT` or
301 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100302--
303
Dave Borowitz4c46c242014-12-03 16:46:45 -0800304[[check]]
305--
306* `CHECK`: include potential problems with the change.
307--
308
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700309[[commit-footers]]
310--
311* `COMMIT_FOOTERS`: include the full commit message with
312 Gerrit-specific commit footers in the
313 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700314--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700315
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400316[[push-certificates]]
317--
318* `PUSH_CERTIFICATES`: include push certificate information in the
319 link:#revision-info[RevisionInfo]. Ignored if signed push is not
320 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
321 server.
322--
323
Edwin Kempin37440832013-02-06 11:36:00 +0100324.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100325----
Edwin Kempinea621482013-10-16 12:58:24 +0200326 GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES&o=DOWNLOAD_COMMANDS HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100327----
Edwin Kempind0a63922013-01-23 16:32:59 +0100328
Edwin Kempin37440832013-02-06 11:36:00 +0100329.Response
330----
Edwin Kempind0a63922013-01-23 16:32:59 +0100331 HTTP/1.1 200 OK
332 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900333 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100334
335 )]}'
336 [
337 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900338 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100339 "project": "gerrit",
340 "branch": "master",
341 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
342 "subject": "Use an EventBus to manage star icons",
343 "status": "NEW",
344 "created": "2012-04-25 00:52:25.580000000",
345 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100346 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100347 "insertions": 16,
348 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100349 "_number": 97,
350 "owner": {
351 "name": "Shawn Pearce"
352 },
353 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
354 "revisions": {
355 "184ebe53805e102605d11f6b143486d15c23a09c": {
356 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100357 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100358 "fetch": {
359 "git": {
360 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200361 "ref": "refs/changes/97/97/1",
362 "commands": {
363 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
364 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
365 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
366 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
367 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100368 },
369 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200370 "url": "http://myuser@127.0.0.1:8080/gerrit",
371 "ref": "refs/changes/97/97/1",
372 "commands": {
373 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
374 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
375 "Format-Patch": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
376 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
377 }
378 },
379 "ssh": {
380 "url": "ssh://myuser@*:29418/gerrit",
381 "ref": "refs/changes/97/97/1",
382 "commands": {
383 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
384 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
385 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
386 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
387 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100388 }
389 },
390 "commit": {
391 "parents": [
392 {
393 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
394 "subject": "Migrate contributor agreements to All-Projects."
395 }
396 ],
397 "author": {
398 "name": "Shawn O. Pearce",
399 "email": "sop@google.com",
400 "date": "2012-04-24 18:08:08.000000000",
401 "tz": -420
402 },
403 "committer": {
404 "name": "Shawn O. Pearce",
405 "email": "sop@google.com",
406 "date": "2012-04-24 18:08:08.000000000",
407 "tz": -420
408 },
409 "subject": "Use an EventBus to manage star icons",
410 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
411 },
412 "files": {
413 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200414 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100415 "size_delta": -412,
416 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100417 },
418 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200419 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100420 "size_delta": 23,
421 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100422 },
423 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
424 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200425 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100426 "size_delta": -298,
427 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100428 },
429 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
430 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200431 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100432 "size_delta": 132,
433 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100434 },
435 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
436 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200437 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100438 "size_delta": -5512,
439 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100440 },
441 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
442 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200443 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100444 "size_delta": 8345,
445 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100446 },
447 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200448 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100449 "size_delta": -343,
450 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100451 }
452 }
453 }
454 }
455 }
456 ]
457----
458
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100459[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800460=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800461--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100462'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800463--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100464
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100465Retrieves a change.
466
Dave Borowitz0314f732013-10-03 09:34:30 -0700467Additional fields can be obtained by adding `o` parameters, each
468option requires more database lookups and slows down the query
469response time to the client so they are generally disabled by
470default. Fields are described in link:#list-changes[Query Changes].
471
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100472.Request
473----
474 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
475----
476
477As response a link:#change-info[ChangeInfo] entity is returned that
478describes the change.
479
480.Response
481----
482 HTTP/1.1 200 OK
483 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900484 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100485
486 )]}'
487 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100488 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
489 "project": "myProject",
490 "branch": "master",
491 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
492 "subject": "Implementing Feature X",
493 "status": "NEW",
494 "created": "2013-02-01 09:59:32.126000000",
495 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100496 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100497 "insertions": 34,
498 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100499 "_number": 3965,
500 "owner": {
501 "name": "John Doe"
502 }
503 }
504----
505
Edwin Kempin8e492202013-02-21 15:38:25 +0100506[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800507=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800508--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100509'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800510--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100511
Edwin Kempin8e492202013-02-21 15:38:25 +0100512Retrieves a change with link:#labels[labels], link:#detailed-labels[
John Spurlock74a70cc2013-03-23 16:41:50 -0400513detailed labels], link:#detailed-accounts[detailed accounts], and
514link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100515
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700516Additional fields can be obtained by adding `o` parameters, each
517option requires more database lookups and slows down the query
518response time to the client so they are generally disabled by
519default. Fields are described in link:#list-changes[Query Changes].
520
Edwin Kempin8e492202013-02-21 15:38:25 +0100521.Request
522----
523 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
524----
525
526As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700527describes the change. This response will contain all votes for each
528label and include one combined vote. The combined label vote is
529calculated in the following order (from highest to lowest):
530REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100531
532.Response
533----
534 HTTP/1.1 200 OK
535 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900536 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100537
538 )]}'
539 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100540 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
541 "project": "myProject",
542 "branch": "master",
543 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
544 "subject": "Implementing Feature X",
545 "status": "NEW",
546 "created": "2013-02-01 09:59:32.126000000",
547 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100548 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100549 "insertions": 126,
550 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100551 "_number": 3965,
552 "owner": {
553 "_account_id": 1000096,
554 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200555 "email": "john.doe@example.com",
556 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100557 },
558 "labels": {
559 "Verified": {
560 "all": [
561 {
562 "value": 0,
563 "_account_id": 1000096,
564 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200565 "email": "john.doe@example.com",
566 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100567 },
568 {
569 "value": 0,
570 "_account_id": 1000097,
571 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200572 "email": "jane.roe@example.com",
573 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100574 }
575 ],
576 "values": {
577 "-1": "Fails",
578 " 0": "No score",
579 "+1": "Verified"
580 }
581 },
582 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100583 "disliked": {
584 "_account_id": 1000096,
585 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200586 "email": "john.doe@example.com",
587 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100588 },
589 "all": [
590 {
591 "value": -1,
592 "_account_id": 1000096,
593 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200594 "email": "john.doe@example.com",
595 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100596 },
597 {
598 "value": 1,
599 "_account_id": 1000097,
600 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200601 "email": "jane.roe@example.com",
602 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100603 }
604 ]
605 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400606 "-2": "This shall not be merged",
607 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100608 " 0": "No score",
609 "+1": "Looks good to me, but someone else must approve",
610 "+2": "Looks good to me, approved"
611 }
612 }
613 },
614 "permitted_labels": {
615 "Verified": [
616 "-1",
617 " 0",
618 "+1"
619 ],
620 "Code-Review": [
621 "-2",
622 "-1",
623 " 0",
624 "+1",
625 "+2"
626 ]
627 },
628 "removable_reviewers": [
629 {
630 "_account_id": 1000096,
631 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200632 "email": "john.doe@example.com",
633 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100634 },
635 {
636 "_account_id": 1000097,
637 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200638 "email": "jane.roe@example.com",
639 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100640 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400641 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800642 "reviewers": {
643 "REVIEWER": [
644 {
645 "_account_id": 1000096,
646 "name": "John Doe",
647 "email": "john.doe@example.com",
648 "username": "jdoe"
649 },
650 {
651 "_account_id": 1000097,
652 "name": "Jane Roe",
653 "email": "jane.roe@example.com",
654 "username": "jroe"
655 }
656 ]
657 },
John Spurlock74a70cc2013-03-23 16:41:50 -0400658 "messages": [
659 {
660 "id": "YH-egE",
661 "author": {
662 "_account_id": 1000096,
663 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200664 "email": "john.doe@example.com",
665 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400666 },
667 "updated": "2013-03-23 21:34:02.419000000",
668 "message": "Patch Set 1:\n\nThis is the first message.",
669 "revision_number": 1
670 },
671 {
672 "id": "WEEdhU",
673 "author": {
674 "_account_id": 1000097,
675 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200676 "email": "jane.roe@example.com",
677 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400678 },
679 "updated": "2013-03-23 21:36:52.332000000",
680 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
681 "revision_number": 1
682 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100683 ]
684 }
685----
686
Edwin Kempin64006bb2013-02-22 08:17:04 +0100687[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800688=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800689--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100690'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800691--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100692
Edwin Kempin64006bb2013-02-22 08:17:04 +0100693Retrieves the topic of a change.
694
695.Request
696----
697 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
698----
699
700.Response
701----
702 HTTP/1.1 200 OK
703 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900704 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100705
706 )]}'
707 "Documentation"
708----
709
710If the change does not have a topic an empty string is returned.
711
712[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800713=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800714--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100715'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800716--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100717
Edwin Kempin64006bb2013-02-22 08:17:04 +0100718Sets the topic of a change.
719
720The new topic must be provided in the request body inside a
721link:#topic-input[TopicInput] entity.
722
723.Request
724----
725 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900726 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100727
728 {
729 "topic": "Documentation"
730 }
731----
732
733As response the new topic is returned.
734
735.Response
736----
737 HTTP/1.1 200 OK
738 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900739 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100740
741 )]}'
742 "Documentation"
743----
744
745If the topic was deleted the response is "`204 No Content`".
746
747[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800748=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800749--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100750'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800751--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100752
Edwin Kempin64006bb2013-02-22 08:17:04 +0100753Deletes the topic of a change.
754
755The request body does not need to include a link:#topic-input[
756TopicInput] entity if no review comment is added.
757
758Please note that some proxies prohibit request bodies for DELETE
759requests. In this case, if you want to specify a commit message, use
760link:#set-topic[PUT] to delete the topic.
761
762.Request
763----
764 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
765----
766
767.Response
768----
769 HTTP/1.1 204 No Content
770----
771
Edwin Kempined5364b2013-02-22 10:39:33 +0100772[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800773=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800774--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100775'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800776--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100777
Edwin Kempined5364b2013-02-22 10:39:33 +0100778Abandons a change.
779
780The request body does not need to include a link:#abandon-input[
781AbandonInput] entity if no review comment is added.
782
783.Request
784----
785 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
786----
787
788As response a link:#change-info[ChangeInfo] entity is returned that
789describes the abandoned change.
790
791.Response
792----
793 HTTP/1.1 200 OK
794 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900795 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100796
797 )]}'
798 {
Edwin Kempined5364b2013-02-22 10:39:33 +0100799 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
800 "project": "myProject",
801 "branch": "master",
802 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
803 "subject": "Implementing Feature X",
804 "status": "ABANDONED",
805 "created": "2013-02-01 09:59:32.126000000",
806 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +0100807 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100808 "insertions": 3,
809 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +0100810 "_number": 3965,
811 "owner": {
812 "name": "John Doe"
813 }
814 }
815----
816
817If the change cannot be abandoned because the change state doesn't
818allow abandoning of the change, the response is "`409 Conflict`" and
819the error message is contained in the response body.
820
821.Response
822----
823 HTTP/1.1 409 Conflict
824 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900825 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100826
827 change is merged
828----
829
830[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800831=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800832--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100833'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800834--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100835
Edwin Kempined5364b2013-02-22 10:39:33 +0100836Restores a change.
837
838The request body does not need to include a link:#restore-input[
839RestoreInput] entity if no review comment is added.
840
841.Request
842----
843 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
844----
845
846As response a link:#change-info[ChangeInfo] entity is returned that
847describes the restored change.
848
849.Response
850----
851 HTTP/1.1 200 OK
852 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900853 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100854
855 )]}'
856 {
Edwin Kempined5364b2013-02-22 10:39:33 +0100857 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
858 "project": "myProject",
859 "branch": "master",
860 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
861 "subject": "Implementing Feature X",
862 "status": "NEW",
863 "created": "2013-02-01 09:59:32.126000000",
864 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +0100865 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100866 "insertions": 2,
867 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +0100868 "_number": 3965,
869 "owner": {
870 "name": "John Doe"
871 }
872 }
873----
874
875If the change cannot be restored because the change state doesn't
876allow restoring the change, the response is "`409 Conflict`" and
877the error message is contained in the response body.
878
879.Response
880----
881 HTTP/1.1 409 Conflict
882 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900883 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100884
885 change is new
886----
887
Edwin Kempincdae63b2013-03-15 15:06:59 +0100888[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800889=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800890--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100891'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800892--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100893
894Rebases a change.
895
Zalan Blenessy874aed72015-01-12 13:26:18 +0100896Optionally, the parent revision can be changed to another patch set through the
897link:#rebase-input[RebaseInput] entity.
898
Edwin Kempincdae63b2013-03-15 15:06:59 +0100899.Request
900----
901 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +0100902 Content-Type: application/json;charset=UTF-8
903
904 {
905 "base" : "1234",
906 }
Edwin Kempincdae63b2013-03-15 15:06:59 +0100907----
908
909As response a link:#change-info[ChangeInfo] entity is returned that
910describes the rebased change. Information about the current patch set
911is included.
912
913.Response
914----
915 HTTP/1.1 200 OK
916 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900917 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +0100918
919 )]}'
920 {
Edwin Kempincdae63b2013-03-15 15:06:59 +0100921 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
922 "project": "myProject",
923 "branch": "master",
924 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
925 "subject": "Implement Feature X",
926 "status": "NEW",
927 "created": "2013-02-01 09:59:32.126000000",
928 "updated": "2013-02-21 11:16:36.775000000",
929 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100930 "insertions": 33,
931 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +0100932 "_number": 4799,
933 "owner": {
934 "name": "John Doe"
935 },
936 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
937 "revisions": {
938 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
939 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100940 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +0100941 "fetch": {
942 "http": {
943 "url": "http://gerrit:8080/myProject",
944 "ref": "refs/changes/99/4799/2"
945 }
946 },
947 "commit": {
948 "parents": [
949 {
950 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
951 "subject": "Implement Feature A"
952 }
953 ],
954 "author": {
955 "name": "John Doe",
956 "email": "john.doe@example.com",
957 "date": "2013-05-07 15:21:27.000000000",
958 "tz": 120
959 },
960 "committer": {
961 "name": "Gerrit Code Review",
962 "email": "gerrit-server@example.com",
963 "date": "2013-05-07 15:35:43.000000000",
964 "tz": 120
965 },
966 "subject": "Implement Feature X",
967 "message": "Implement Feature X\n\nAdded feature X."
968 }
969 }
970 }
971----
972
973If the change cannot be rebased, e.g. due to conflicts, the response is
974"`409 Conflict`" and the error message is contained in the response
975body.
976
977.Response
978----
979 HTTP/1.1 409 Conflict
980 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900981 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +0100982
983 The change could not be rebased due to a path conflict during merge.
984----
985
Raviteja Sunkara791f3392015-11-03 13:24:50 +0530986[[move-change]]
987=== Move Change
988--
989'POST /changes/link:#change-id[\{change-id\}]/move'
990--
991
992Move a change.
993
994The destination branch must be provided in the request body inside a
995link:#move-input[MoveInput] entity.
996
997.Request
998----
999 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1000 Content-Type: application/json; charset=UTF-8
1001
1002 {
1003 "destination_branch" : "release-branch"
1004 }
1005
1006----
1007
1008As response a link:#change-info[ChangeInfo] entity is returned that
1009describes the moved change.
1010
1011.Response
1012----
1013 HTTP/1.1 200 OK
1014 Content-Disposition: attachment
1015 Content-Type: application/json; charset=UTF-8
1016
1017 )]}'
1018 {
1019 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1020 "project": "myProject",
1021 "branch": "release-branch",
1022 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1023 "subject": "Implementing Feature X",
1024 "status": "NEW",
1025 "created": "2013-02-01 09:59:32.126000000",
1026 "updated": "2013-02-21 11:16:36.775000000",
1027 "mergeable": true,
1028 "insertions": 2,
1029 "deletions": 13,
1030 "_number": 3965,
1031 "owner": {
1032 "name": "John Doe"
1033 }
1034 }
1035----
1036
1037If the change cannot be moved because the change state doesn't
1038allow moving the change, the response is "`409 Conflict`" and
1039the error message is contained in the response body.
1040
1041.Response
1042----
1043 HTTP/1.1 409 Conflict
1044 Content-Disposition: attachment
1045 Content-Type: text/plain; charset=UTF-8
1046
1047 change is merged
1048----
1049
1050If the change cannot be moved because the user doesn't have
1051abandon permission on the change or upload permission on the destination,
1052the response is "`409 Conflict`" and the error message is contained in the
1053response body.
1054
1055.Response
1056----
1057 HTTP/1.1 409 Conflict
1058 Content-Disposition: attachment
1059 Content-Type: text/plain; charset=UTF-8
1060
1061 move not permitted
1062----
1063
Edwin Kempind2ec4152013-02-22 12:17:19 +01001064[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001065=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001066--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001067'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001068--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001069
Edwin Kempind2ec4152013-02-22 12:17:19 +01001070Reverts a change.
1071
1072The request body does not need to include a link:#revert-input[
1073RevertInput] entity if no review comment is added.
1074
1075.Request
1076----
Michael Zhou10270492016-03-24 22:35:40 -04001077 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001078----
1079
1080As response a link:#change-info[ChangeInfo] entity is returned that
1081describes the reverting change.
1082
1083.Response
1084----
1085 HTTP/1.1 200 OK
1086 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001087 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001088
1089 )]}'
1090 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001091 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1092 "project": "myProject",
1093 "branch": "master",
1094 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1095 "subject": "Revert \"Implementing Feature X\"",
1096 "status": "NEW",
1097 "created": "2013-02-01 09:59:32.126000000",
1098 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001099 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001100 "insertions": 6,
1101 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001102 "_number": 3965,
1103 "owner": {
1104 "name": "John Doe"
1105 }
1106 }
1107----
1108
1109If the change cannot be reverted because the change state doesn't
1110allow reverting the change, the response is "`409 Conflict`" and
1111the error message is contained in the response body.
1112
1113.Response
1114----
1115 HTTP/1.1 409 Conflict
1116 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001117 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001118
1119 change is new
1120----
1121
Edwin Kempin0eddba02013-02-22 15:30:12 +01001122[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001123=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001124--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001125'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001126--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001127
Edwin Kempin0eddba02013-02-22 15:30:12 +01001128Submits a change.
1129
1130The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001131SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001132
1133.Request
1134----
1135 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001136 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001137
1138 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001139 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001140 }
1141----
1142
1143As response a link:#change-info[ChangeInfo] entity is returned that
1144describes the submitted/merged change.
1145
1146.Response
1147----
1148 HTTP/1.1 200 OK
1149 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001150 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001151
1152 )]}'
1153 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001154 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1155 "project": "myProject",
1156 "branch": "master",
1157 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1158 "subject": "Implementing Feature X",
1159 "status": "MERGED",
1160 "created": "2013-02-01 09:59:32.126000000",
1161 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001162 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001163 "_number": 3965,
1164 "owner": {
1165 "name": "John Doe"
1166 }
1167 }
1168----
1169
1170If the change cannot be submitted because the submit rule doesn't allow
1171submitting the change, the response is "`409 Conflict`" and the error
1172message is contained in the response body.
1173
1174.Response
1175----
1176 HTTP/1.1 409 Conflict
1177 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001178 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001179
1180 blocked by Verified
1181----
1182
David Pursehouse025c1af2015-11-20 17:02:50 +09001183[[submitted-together]]
Stefan Bellera7ad6612015-06-26 10:05:43 -07001184=== Changes submitted together
1185--
1186'GET /changes/link:#change-id[\{change-id\}]/submitted_together'
1187--
1188
1189Returns a list of all changes which are submitted when
Stefan Beller460f3542015-07-20 14:10:41 -07001190link:#submit-change[\{submit\}] is called for this change,
1191including the current change itself.
1192
1193An empty list is returned if this change will be submitted
1194by itself (no other changes).
Stefan Bellera7ad6612015-06-26 10:05:43 -07001195
1196.Request
1197----
1198 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together HTTP/1.0
1199 Content-Type: application/json; charset=UTF-8
1200----
1201
1202The return value is a list of changes in the same format as in
1203link:#list-changes[\{listing changes\}] with the options
1204link:#labels[\{LABELS\}], link:#detailed-labels[\{DETAILED_LABELS\}],
1205link:#current-revision[\{CURRENT_REVISION\}],
1206link:#current-commit[\{CURRENT_COMMIT\}] set.
1207The list consists of:
1208
1209* The given change.
1210* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1211 is enabled, include all open changes with the same topic.
1212* For each change whose submit type is not CHERRY_PICK, include unmerged
1213 ancestors targeting the same branch.
1214
1215.Response
1216----
1217 HTTP/1.1 200 OK
1218 Content-Disposition: attachment
1219 Content-Type: application/json; charset=UTF-8
1220
1221)]}'
1222[
1223 {
1224 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1225 "project": "gerrit",
1226 "branch": "master",
1227 "hashtags": [],
1228 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1229 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1230 "status": "NEW",
1231 "created": "2015-05-01 15:39:57.979000000",
1232 "updated": "2015-05-20 19:25:21.592000000",
1233 "mergeable": true,
1234 "insertions": 303,
1235 "deletions": 210,
1236 "_number": 1779,
1237 "owner": {
1238 "_account_id": 1000000
1239 },
1240 "labels": {
1241 "Code-Review": {
1242 "approved": {
1243 "_account_id": 1000000
1244 },
1245 "all": [
1246 {
1247 "value": 2,
1248 "date": "2015-05-20 19:25:21.592000000",
1249 "_account_id": 1000000
1250 }
1251 ],
1252 "values": {
1253 "-2": "This shall not be merged",
1254 "-1": "I would prefer this is not merged as is",
1255 " 0": "No score",
1256 "+1": "Looks good to me, but someone else must approve",
1257 "+2": "Looks good to me, approved"
1258 },
1259 "default_value": 0
1260 },
1261 "Verified": {
1262 "approved": {
1263 "_account_id": 1000000
1264 },
1265 "all": [
1266 {
1267 "value": 1,
1268 "date": "2015-05-20 19:25:21.592000000",
1269 "_account_id": 1000000
1270 }
1271 ],
1272 "values": {
1273 "-1": "Fails",
1274 " 0": "No score",
1275 "+1": "Verified"
1276 },
1277 "default_value": 0
1278 }
1279 },
1280 "permitted_labels": {
1281 "Code-Review": [
1282 "-2",
1283 "-1",
1284 " 0",
1285 "+1",
1286 "+2"
1287 ],
1288 "Verified": [
1289 "-1",
1290 " 0",
1291 "+1"
1292 ]
1293 },
1294 "removable_reviewers": [
1295 {
1296 "_account_id": 1000000
1297 }
1298 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08001299 "reviewers": {
1300 "REVIEWER": [
1301 {
1302 "_account_id": 1000000
1303 }
1304 ]
1305 },
Stefan Bellera7ad6612015-06-26 10:05:43 -07001306 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1307 "revisions": {
1308 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
1309 "_number": 1,
1310 "created": "2015-05-01 15:39:57.979000000",
1311 "uploader": {
1312 "_account_id": 1000000
1313 },
1314 "ref": "refs/changes/79/1779/1",
1315 "fetch": {},
1316 "commit": {
1317 "parents": [
1318 {
1319 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1320 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1321 }
1322 ],
1323 "author": {
1324 "name": "Stefan Beller",
1325 "email": "sbeller@google.com",
1326 "date": "2015-04-29 21:36:52.000000000",
1327 "tz": -420
1328 },
1329 "committer": {
1330 "name": "Stefan Beller",
1331 "email": "sbeller@google.com",
1332 "date": "2015-05-01 00:11:16.000000000",
1333 "tz": -420
1334 },
1335 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1336 "message": "ChangeMergeQueue: Rewrite such that it works on set of changes\n\nChangeMergeQueue used to work on branches rather than sets of changes.\nThis change is a first step to merge sets of changes (e.g. grouped by a\ntopic and `changes.submitWholeTopic` enabled) in an atomic fashion.\nThis change doesn\u0027t aim to implement these changes, but only as a step\ntowards it.\n\nMergeOp keeps its functionality and behavior as is. A new class\nMergeOpMapper is introduced which will map the set of changes to\nthe set of branches. Additionally the MergeOpMapper is also\nresponsible for the threading done right now, which was part of\nthe ChangeMergeQueue before.\n\nChange-Id: I1ffe09a505e25f15ce1521bcfb222e51e62c2a14\n"
1337 }
1338 }
1339 }
1340 },
1341 {
1342 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1343 "project": "gerrit",
1344 "branch": "master",
1345 "hashtags": [],
1346 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1347 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1348 "status": "NEW",
1349 "created": "2015-05-01 15:39:57.979000000",
1350 "updated": "2015-05-20 19:25:21.546000000",
1351 "mergeable": true,
1352 "insertions": 15,
1353 "deletions": 6,
1354 "_number": 1780,
1355 "owner": {
1356 "_account_id": 1000000
1357 },
1358 "labels": {
1359 "Code-Review": {
1360 "approved": {
1361 "_account_id": 1000000
1362 },
1363 "all": [
1364 {
1365 "value": 2,
1366 "date": "2015-05-20 19:25:21.546000000",
1367 "_account_id": 1000000
1368 }
1369 ],
1370 "values": {
1371 "-2": "This shall not be merged",
1372 "-1": "I would prefer this is not merged as is",
1373 " 0": "No score",
1374 "+1": "Looks good to me, but someone else must approve",
1375 "+2": "Looks good to me, approved"
1376 },
1377 "default_value": 0
1378 },
1379 "Verified": {
1380 "approved": {
1381 "_account_id": 1000000
1382 },
1383 "all": [
1384 {
1385 "value": 1,
1386 "date": "2015-05-20 19:25:21.546000000",
1387 "_account_id": 1000000
1388 }
1389 ],
1390 "values": {
1391 "-1": "Fails",
1392 " 0": "No score",
1393 "+1": "Verified"
1394 },
1395 "default_value": 0
1396 }
1397 },
1398 "permitted_labels": {
1399 "Code-Review": [
1400 "-2",
1401 "-1",
1402 " 0",
1403 "+1",
1404 "+2"
1405 ],
1406 "Verified": [
1407 "-1",
1408 " 0",
1409 "+1"
1410 ]
1411 },
1412 "removable_reviewers": [
1413 {
1414 "_account_id": 1000000
1415 }
1416 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08001417 "reviewers": {
1418 "REVIEWER": [
1419 {
1420 "_account_id": 1000000
1421 }
1422 ]
1423 },
Stefan Bellera7ad6612015-06-26 10:05:43 -07001424 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1425 "revisions": {
1426 "1bd7c12a38854a2c6de426feec28800623f492c4": {
1427 "_number": 1,
1428 "created": "2015-05-01 15:39:57.979000000",
1429 "uploader": {
1430 "_account_id": 1000000
1431 },
1432 "ref": "refs/changes/80/1780/1",
1433 "fetch": {},
1434 "commit": {
1435 "parents": [
1436 {
1437 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1438 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1439 }
1440 ],
1441 "author": {
1442 "name": "Stefan Beller",
1443 "email": "sbeller@google.com",
1444 "date": "2015-04-25 00:11:59.000000000",
1445 "tz": -420
1446 },
1447 "committer": {
1448 "name": "Stefan Beller",
1449 "email": "sbeller@google.com",
1450 "date": "2015-05-01 00:11:16.000000000",
1451 "tz": -420
1452 },
1453 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1454 "message": "AbstractSubmoduleSubscription: Split up createSubscription\n\nLater we want to have subscriptions to more submodules, so we need to\nfind a way to add more submodule entries into the file. By splitting up\nthe createSubscription() method, that is very easy by using the\naddSubmoduleSubscription method multiple times.\n\nChange-Id: I7fe807e63792b3d26776fd1422e5e790a5697e22\n"
1455 }
1456 }
1457 }
1458 }
1459]
1460----
1461
1462
David Ostrovsky0d69c232013-09-10 23:10:23 +02001463[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001464=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001465--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001466'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001467--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001468
1469Publishes a draft change.
1470
1471.Request
1472----
1473 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001474 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001475----
1476
1477.Response
1478----
1479 HTTP/1.1 204 No Content
1480----
1481
1482[[delete-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001483=== Delete Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001484--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001485'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001486--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001487
1488Deletes a draft change.
1489
1490.Request
1491----
1492 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001493 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001494----
1495
1496.Response
1497----
1498 HTTP/1.1 204 No Content
1499----
1500
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001501[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001502=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001503--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001504'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001505--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001506
1507Retrieves the branches and tags in which a change is included. As result
1508an link:#included-in-info[IncludedInInfo] entity is returned.
1509
1510.Request
1511----
1512 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1513----
1514
1515.Response
1516----
1517 HTTP/1.1 200 OK
1518 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001519 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001520
1521 )]}'
1522 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001523 "branches": [
1524 "master"
1525 ],
1526 "tags": []
1527 }
1528----
1529
David Pursehouse4e38b972014-05-30 10:36:40 +09001530[[index-change]]
1531=== Index Change
1532--
1533'POST /changes/link:#change-id[\{change-id\}]/index'
1534--
1535
1536Adds or updates the change in the secondary index.
1537
1538.Request
1539----
1540 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1541----
1542
1543.Response
1544----
1545 HTTP/1.1 204 No Content
1546----
1547
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001548[[list-change-comments]]
1549=== List Change Comments
1550--
1551'GET /changes/link:#change-id[\{change-id\}]/comments'
1552--
1553
1554Lists the published comments of all revisions of the change.
1555
1556Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1557entries. The entries in the map are sorted by file path, and the
1558comments for each path are sorted by patch set number. Each comment has
1559the `patch_set` and `author` fields set.
1560
1561.Request
1562----
1563 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1564----
1565
1566.Response
1567----
1568 HTTP/1.1 200 OK
1569 Content-Disposition: attachment
1570 Content-Type: application/json; charset=UTF-8
1571
1572 )]}'
1573 {
1574 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1575 {
1576 "patch_set": 1,
1577 "id": "TvcXrmjM",
1578 "line": 23,
1579 "message": "[nit] trailing whitespace",
1580 "updated": "2013-02-26 15:40:43.986000000"
1581 "author": {
1582 "_account_id": 1000096,
1583 "name": "John Doe",
1584 "email": "john.doe@example.com"
1585 }
1586 },
1587 {
1588 "patch_set": 2,
1589 "id": "TveXwFiA",
1590 "line": 49,
1591 "in_reply_to": "TfYX-Iuo",
1592 "message": "Done",
1593 "updated": "2013-02-26 15:40:45.328000000"
1594 "author": {
1595 "_account_id": 1000097,
1596 "name": "Jane Roe",
1597 "email": "jane.roe@example.com"
1598 }
1599 }
1600 ]
1601 }
1602----
1603
1604[[list-change-drafts]]
1605=== List Change Drafts
1606--
1607'GET /changes/link:#change-id[\{change-id\}]/drafts'
1608--
1609
1610Lists the draft comments of all revisions of the change that belong to
1611the calling user.
1612
1613Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1614entries. The entries in the map are sorted by file path, and the
1615comments for each path are sorted by patch set number. Each comment has
1616the `patch_set` field set, and no `author`.
1617
1618.Request
1619----
1620 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
1621----
1622
1623.Response
1624----
1625 HTTP/1.1 200 OK
1626 Content-Disposition: attachment
1627 Content-Type: application/json; charset=UTF-8
1628
1629 )]}'
1630 {
1631 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1632 {
1633 "patch_set": 1,
1634 "id": "TvcXrmjM",
1635 "line": 23,
1636 "message": "[nit] trailing whitespace",
1637 "updated": "2013-02-26 15:40:43.986000000"
1638 },
1639 {
1640 "patch_set": 2,
1641 "id": "TveXwFiA",
1642 "line": 49,
1643 "in_reply_to": "TfYX-Iuo",
1644 "message": "Done",
1645 "updated": "2013-02-26 15:40:45.328000000"
1646 }
1647 ]
1648 }
1649----
1650
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001651[[check-change]]
1652=== Check change
1653--
1654'GET /changes/link:#change-id[\{change-id\}]/check'
1655--
1656
1657Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05001658link:#change-info[ChangeInfo] entity with the `problems` field set to a
1659list of link:#problem-info[ProblemInfo] entities.
1660
1661Depending on the type of problem, some fields not marked optional may be
1662missing from the result. At least `id`, `project`, `branch`, and
1663`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001664
1665.Request
1666----
1667 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
1668----
1669
1670.Response
1671----
1672 HTTP/1.1 200 OK
1673 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001674 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001675
1676 )]}'
1677 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05001678 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1679 "project": "myProject",
1680 "branch": "master",
1681 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1682 "subject": "Implementing Feature X",
1683 "status": "NEW",
1684 "created": "2013-02-01 09:59:32.126000000",
1685 "updated": "2013-02-21 11:16:36.775000000",
1686 "mergeable": true,
1687 "insertions": 34,
1688 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05001689 "_number": 3965,
1690 "owner": {
1691 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001692 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05001693 "problems": [
1694 {
1695 "message": "Current patch set 1 not found"
1696 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001697 ]
1698 }
1699----
1700
Dave Borowitz3be39d02014-12-03 17:57:38 -08001701[[fix-change]]
1702=== Fix change
1703--
1704'POST /changes/link:#change-id[\{change-id\}]/check'
1705--
1706
1707Performs consistency checks on the change as with link:#check-change[GET
1708/check], and additionally fixes any problems that can be fixed
1709automatically. The returned field values reflect any fixes.
1710
Dave Borowitzbad53ee2015-06-11 10:10:18 -04001711Some fixes have options controlling their behavior, which can be set in the
1712link:#fix-input[FixInput] entity body.
1713
Dave Borowitz3be39d02014-12-03 17:57:38 -08001714Only the change owner, a project owner, or an administrator may fix changes.
1715
1716.Request
1717----
1718 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
1719----
1720
1721.Response
1722----
1723 HTTP/1.1 200 OK
1724 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001725 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08001726
1727 )]}'
1728 {
1729 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1730 "project": "myProject",
1731 "branch": "master",
1732 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1733 "subject": "Implementing Feature X",
1734 "status": "MERGED",
1735 "created": "2013-02-01 09:59:32.126000000",
1736 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001737 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08001738 "mergeable": true,
1739 "insertions": 34,
1740 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08001741 "_number": 3965,
1742 "owner": {
1743 "name": "John Doe"
1744 },
1745 "problems": [
1746 {
1747 "message": "Current patch set 2 not found"
1748 },
1749 {
1750 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
1751 "status": FIXED,
1752 "outcome": "Marked change as merged"
1753 }
1754 ]
1755 }
1756----
1757
David Ostrovsky1a49f622014-07-29 00:40:02 +02001758[[edit-endpoints]]
1759== Change Edit Endpoints
1760
David Ostrovsky1a49f622014-07-29 00:40:02 +02001761[[get-edit-detail]]
1762=== Get Change Edit Details
1763--
1764'GET /changes/link:#change-id[\{change-id\}]/edit
1765--
1766
1767Retrieves a change edit details.
1768
1769.Request
1770----
1771 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1772----
1773
1774As response an link:#edit-info[EditInfo] entity is returned that
1775describes the change edit, or "`204 No Content`" when change edit doesn't
1776exist for this change. Change edits are stored on special branches and there
1777can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02001778When request parameter `list` is provided the response also includes the file
1779list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02001780against this base revision. When request parameter `download-commands` is
1781provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02001782
1783.Response
1784----
1785 HTTP/1.1 200 OK
1786 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001787 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02001788
1789 )]}'
1790 {
1791 "commit":{
1792 "parents":[
1793 {
1794 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
1795 }
1796 ],
1797 "author":{
1798 "name":"Shawn O. Pearce",
1799 "email":"sop@google.com",
1800 "date":"2012-04-24 18:08:08.000000000",
1801 "tz":-420
1802 },
1803 "committer":{
1804 "name":"Shawn O. Pearce",
1805 "email":"sop@google.com",
1806 "date":"2012-04-24 18:08:08.000000000",
1807 "tz":-420
1808 },
1809 "subject":"Use an EventBus to manage star icons",
1810 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1811 },
Michael Zhoud03fe282016-04-25 17:13:17 -04001812 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02001813 }
1814----
David Pursehouse4e38b972014-05-30 10:36:40 +09001815
David Ostrovskya5ab8292014-08-01 02:11:39 +02001816[[put-edit-file]]
1817=== Change file content in Change Edit
1818--
1819'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
1820--
1821
1822Put content of a file to a change edit.
1823
1824.Request
1825----
1826 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1827----
1828
1829When change edit doesn't exist for this change yet it is created. When file
1830content isn't provided, it is wiped out for that file. As response
1831"`204 No Content`" is returned.
1832
1833.Response
1834----
1835 HTTP/1.1 204 No Content
1836----
1837
David Ostrovsky138edb42014-08-15 21:31:43 +02001838[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01001839=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02001840--
1841'POST /changes/link:#change-id[\{change-id\}]/edit
1842--
1843
David Ostrovskya00c9532015-01-21 00:17:49 +01001844Creates empty change edit, restores file content or renames files in change
1845edit. The request body needs to include a
1846link:#change-edit-input[ChangeEditInput] entity when a file within change
1847edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02001848
1849.Request
1850----
1851 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001852 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02001853
1854 {
David Ostrovskybd12e172014-08-21 23:08:15 +02001855 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02001856 }
1857----
1858
David Ostrovskya00c9532015-01-21 00:17:49 +01001859or for rename:
1860
1861.Request
1862----
1863 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1864 Content-Type: application/json; charset=UTF-8
1865
1866 {
1867 "old_path": "foo",
1868 "new_path": "bar"
1869 }
1870----
1871
David Ostrovsky138edb42014-08-15 21:31:43 +02001872When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01001873and restore flag are provided in request body, this file is restored. When
1874old and new file names are provided, the file is renamed. As response
1875"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02001876
1877.Response
1878----
1879 HTTP/1.1 204 No Content
1880----
1881
David Ostrovskyc967e152014-10-24 17:36:16 +02001882[[put-change-edit-message]]
1883=== Change commit message in Change Edit
1884--
1885'PUT /changes/link:#change-id[\{change-id\}]/edit:message
1886--
1887
1888Modify commit message. The request body needs to include a
1889link:#change-edit-message-input[ChangeEditMessageInput]
1890entity.
1891
1892.Request
1893----
1894 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001895 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02001896
1897 {
1898 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
1899 }
1900----
1901
1902If a change edit doesn't exist for this change yet, it is created. As
1903response "`204 No Content`" is returned.
1904
1905.Response
1906----
1907 HTTP/1.1 204 No Content
1908----
1909
David Ostrovsky2830c292014-08-01 02:24:31 +02001910[[delete-edit-file]]
1911=== Delete file in Change Edit
1912--
1913'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
1914--
1915
1916Deletes a file from a change edit. This deletes the file from the repository
1917completely. This is not the same as reverting or restoring a file to its
1918previous contents.
1919
1920.Request
1921----
1922 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1923----
1924
1925When change edit doesn't exist for this change yet it is created.
1926
1927.Response
1928----
1929 HTTP/1.1 204 No Content
1930----
1931
David Ostrovskyfd6c1752014-08-01 19:43:21 +02001932[[get-edit-file]]
1933=== Retrieve file content from Change Edit
1934--
1935'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
1936--
1937
1938Retrieves content of a file from a change edit.
1939
1940.Request
1941----
1942 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1943----
1944
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05001945The content of the file is returned as text encoded inside base64.
1946The Content-Type header will always be `text/plain` reflecting the
1947outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
1948can be examined to find the server detected content type of the file.
1949
1950When the specified file was deleted in the change edit
1951"`204 No Content`" is returned.
1952
1953If only the content type is required, callers should use HEAD to
1954avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02001955
Michael Zhou551ad0c2016-04-26 01:21:42 -04001956If the `base` parameter is set to true, the returned content is from the
1957revision that the edit is based on.
1958
David Ostrovskyfd6c1752014-08-01 19:43:21 +02001959.Response
1960----
1961 HTTP/1.1 200 OK
1962 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001963 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02001964 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05001965 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02001966
1967 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
1968----
1969
David Ostrovskyd0078672015-02-06 21:51:04 +01001970Alternatively, if the only value of the Accept request header is
1971`application/json` the content is returned as JSON string and
1972`X-FYI-Content-Encoding` is set to `json`.
1973
David Ostrovsky9ea9c112015-01-25 00:12:38 +01001974[[get-edit-meta-data]]
1975=== Retrieve meta data of a file from Change Edit
1976--
1977'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
1978--
1979
1980Retrieves meta data of a file from a change edit. Currently only
1981web links are returned.
1982
1983.Request
1984----
1985 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
1986----
1987
1988This REST endpoint retrieves additional information for a file in a
1989change edit. As result an link:#edit-file-info[EditFileInfo] entity is
1990returned.
1991
1992.Response
1993----
1994 HTTP/1.1 200 OK
1995 Content-Disposition: attachment
1996 Content-Type: application/json; charset=UTF-8
1997
1998 )]}'
1999 {
2000 "web_links":[
2001 {
2002 "show_on_side_by_side_diff_view": true,
2003 "name": "side-by-side preview diff",
2004 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2005 "url": "#/x/xdocs/c/42/1..0/README.md",
2006 "target": "_self"
2007 },
2008 {
2009 "show_on_unified_diff_view": true,
2010 "name": "unified preview diff",
2011 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2012 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2013 "target": "_self"
2014 }
2015 ]}
2016----
2017
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002018[[get-edit-message]]
2019=== Retrieve commit message from Change Edit or current patch set of the change
2020--
2021'GET /changes/link:#change-id[\{change-id\}]/edit:message
2022--
2023
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002024Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002025
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002026If the `base` parameter is set to true, the returned message is from the
2027revision that the edit is based on.
2028
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002029.Request
2030----
2031 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2032----
2033
2034The commit message is returned as base64 encoded string.
2035
2036.Response
2037----
2038 HTTP/1.1 200 OK
2039
2040 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2041M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2042----
2043
David Ostrovskyd0078672015-02-06 21:51:04 +01002044Alternatively, if the only value of the Accept request header is
2045`application/json` the commit message is returned as JSON string:
2046
2047.Response
2048----
2049 HTTP/1.1 200 OK
2050
2051)]}'
2052"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2053----
2054
2055
David Ostrovskye9988f92014-08-01 09:56:34 +02002056[[publish-edit]]
2057=== Publish Change Edit
2058--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002059'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002060--
2061
2062Promotes change edit to a regular patch set.
2063
2064.Request
2065----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002066 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
David Ostrovskye9988f92014-08-01 09:56:34 +02002067----
2068
2069As response "`204 No Content`" is returned.
2070
2071.Response
2072----
2073 HTTP/1.1 204 No Content
2074----
2075
David Ostrovsky46999d22014-08-16 02:19:13 +02002076[[rebase-edit]]
2077=== Rebase Change Edit
2078--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002079'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002080--
2081
2082Rebases change edit on top of latest patch set.
2083
2084.Request
2085----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002086 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002087----
2088
2089When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002090"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002091based on top of the latest patch set, the response
2092"`409 Conflict`" is returned.
2093
2094.Response
2095----
2096 HTTP/1.1 204 No Content
2097----
2098
David Ostrovsky8e75f502014-08-10 00:36:31 +02002099[[delete-edit]]
2100=== Delete Change Edit
2101--
2102'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2103--
2104
2105Deletes change edit.
2106
2107.Request
2108----
2109 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2110----
2111
2112As response "`204 No Content`" is returned.
2113
2114.Response
2115----
2116 HTTP/1.1 204 No Content
2117----
2118
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002119[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002120== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002121
2122[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002123=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002124--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002125'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002126--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002127
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002128Lists the reviewers of a change.
2129
2130As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2131
2132.Request
2133----
2134 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2135----
2136
2137.Response
2138----
2139 HTTP/1.1 200 OK
2140 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002141 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002142
2143 )]}'
2144 [
2145 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002146 "approvals": {
2147 "Verified": "+1",
2148 "Code-Review": "+2"
2149 },
2150 "_account_id": 1000096,
2151 "name": "John Doe",
2152 "email": "john.doe@example.com"
2153 },
2154 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002155 "approvals": {
2156 "Verified": " 0",
2157 "Code-Review": "-1"
2158 },
2159 "_account_id": 1000097,
2160 "name": "Jane Roe",
2161 "email": "jane.roe@example.com"
2162 }
2163 ]
2164----
2165
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002166[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002167=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002168--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002169'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002170--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002171
2172Suggest the reviewers for a given query `q` and result limit `n`. If result
2173limit is not passed, then the default 10 is used.
2174
2175As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2176
2177.Request
2178----
2179 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2180----
2181
2182.Response
2183----
2184 HTTP/1.1 200 OK
2185 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002186 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002187
2188 )]}'
2189 [
2190 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002191 "account": {
2192 "_account_id": 1000097,
2193 "name": "Jane Roe",
2194 "email": "jane.roe@example.com"
2195 }
2196 },
2197 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002198 "group": {
2199 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2200 "name": "Joiner"
2201 }
2202 }
2203 ]
2204----
2205
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002206[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002207=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002208--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002209'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002210--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002211
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002212Retrieves a reviewer of a change.
2213
2214As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2215describes the reviewer.
2216
2217.Request
2218----
2219 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2220----
2221
2222.Response
2223----
2224 HTTP/1.1 200 OK
2225 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002226 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002227
2228 )]}'
2229 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002230 "approvals": {
2231 "Verified": "+1",
2232 "Code-Review": "+2"
2233 },
2234 "_account_id": 1000096,
2235 "name": "John Doe",
2236 "email": "john.doe@example.com"
2237 }
2238----
2239
Edwin Kempin392328e2013-02-25 12:50:03 +01002240[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002241=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002242--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002243'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002244--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002245
Edwin Kempin392328e2013-02-25 12:50:03 +01002246Adds one user or all members of one group as reviewer to the change.
2247
2248The reviewer to be added to the change must be provided in the request
2249body as a link:#reviewer-input[ReviewerInput] entity.
2250
2251.Request
2252----
2253 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002254 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002255
2256 {
2257 "reviewer": "john.doe@example.com"
2258 }
2259----
2260
2261As response an link:#add-reviewer-result[AddReviewerResult] entity is
2262returned that describes the newly added reviewers.
2263
2264.Response
2265----
2266 HTTP/1.1 200 OK
2267 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002268 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002269
2270 )]}'
2271 {
2272 "reviewers": [
2273 {
Edwin Kempin392328e2013-02-25 12:50:03 +01002274 "approvals": {
2275 "Verified": " 0",
2276 "Code-Review": " 0"
2277 },
2278 "_account_id": 1000096,
2279 "name": "John Doe",
2280 "email": "john.doe@example.com"
2281 }
2282 ]
2283 }
2284----
2285
2286If a group is specified, adding the group members as reviewers is an
2287atomic operation. This means if an error is returned, none of the
2288members are added as reviewer.
2289
2290If a group with many members is added as reviewer a confirmation may be
2291required.
2292
2293.Request
2294----
2295 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002296 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002297
2298 {
2299 "reviewer": "MyProjectVerifiers"
2300 }
2301----
2302
2303.Response
2304----
2305 HTTP/1.1 200 OK
2306 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002307 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002308
2309 )]}'
2310 {
2311 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2312 "confirm": true
2313 }
2314----
2315
2316To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002317`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002318
2319.Request
2320----
2321 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002322 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002323
2324 {
2325 "reviewer": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01002326 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01002327 }
2328----
2329
Edwin Kempin53301072013-02-25 12:57:07 +01002330[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002331=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002332--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002333'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002334--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002335
Edwin Kempin53301072013-02-25 12:57:07 +01002336Deletes a reviewer from a change.
2337
2338.Request
2339----
2340 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
2341----
2342
2343.Response
2344----
2345 HTTP/1.1 204 No Content
2346----
2347
David Ostrovskybeb0b842014-12-13 00:24:29 +01002348[[list-votes]]
2349=== List Votes
2350--
2351'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
2352--
2353
2354Lists the votes for a specific reviewer of the change.
2355
2356.Request
2357----
2358 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
2359----
2360
2361As result a map is returned that maps the label name to the label value.
2362The entries in the map are sorted by label name.
2363
2364.Response
2365----
2366 HTTP/1.1 200 OK
2367 Content-Disposition: attachment
2368 Content-Type: application/json;charset=UTF-8
2369
2370 )]}'
2371 {
2372 "Code-Review": -1,
2373 "Verified": 1
2374 "Work-In-Progress": 1,
2375 }
2376----
2377
2378[[delete-vote]]
2379=== Delete Vote
2380--
2381'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]'
2382--
2383
2384Deletes a single vote from a change. Note, that even when the last vote of
2385a reviewer is removed the reviewer itself is still listed on the change.
2386
2387.Request
2388----
2389 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
2390----
2391
2392.Response
2393----
2394 HTTP/1.1 204 No Content
2395----
2396
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002397[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002398== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002399
Shawn Pearce728ba882013-07-08 23:13:08 -07002400[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002401=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002402--
Shawn Pearce728ba882013-07-08 23:13:08 -07002403'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002404--
Shawn Pearce728ba882013-07-08 23:13:08 -07002405
2406Retrieves a parsed commit of a revision.
2407
2408.Request
2409----
2410 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
2411----
2412
2413As response a link:#commit-info[CommitInfo] entity is returned that
2414describes the revision.
2415
2416.Response
2417----
2418 HTTP/1.1 200 OK
2419 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002420 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07002421
2422 )]}'
2423 {
Edwin Kempinc8237402015-07-15 18:27:55 +02002424 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07002425 "parents": [
2426 {
2427 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2428 "subject": "Migrate contributor agreements to All-Projects."
2429 }
2430 ],
2431 "author": {
2432 "name": "Shawn O. Pearce",
2433 "email": "sop@google.com",
2434 "date": "2012-04-24 18:08:08.000000000",
2435 "tz": -420
2436 },
2437 "committer": {
2438 "name": "Shawn O. Pearce",
2439 "email": "sop@google.com",
2440 "date": "2012-04-24 18:08:08.000000000",
2441 "tz": -420
2442 },
2443 "subject": "Use an EventBus to manage star icons",
2444 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2445 }
2446----
2447
Sven Selbergd26bd542014-11-21 16:28:10 +01002448Adding query parameter `links` (for example `/changes/.../commit?links`)
2449returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07002450
Stefan Bellerc7259662015-02-12 17:23:05 -08002451[[get-revision-actions]]
2452=== Get Revision Actions
2453--
2454'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
2455--
2456
2457Retrieves revision link:#action-info[actions] of the revision of a change.
2458
2459.Request
2460----
2461 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
2462----
2463
2464.Response
2465----
2466 HTTP/1.1 200 OK
2467 Content-Disposition: attachment
2468 Content-Type: application/json; charset=UTF-8
2469
2470 )]}'
2471
2472{
2473 "submit": {
2474 "method": "POST",
2475 "label": "Submit",
2476 "title": "Submit patch set 1 into master",
2477 "enabled": true
2478 },
2479 "cherrypick": {
2480 "method": "POST",
2481 "label": "Cherry Pick",
2482 "title": "Cherry pick change to a different branch",
2483 "enabled": true
2484 }
2485}
2486----
2487
2488The response is a flat map of possible revision actions mapped to their
2489link:#action-info[ActionInfo].
2490
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002491[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002492=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002493--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002494'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002495--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002496
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002497Retrieves a review of a revision.
2498
2499.Request
2500----
2501 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
2502----
2503
2504As response a link:#change-info[ChangeInfo] entity with
2505link:#detailed-labels[detailed labels] and link:#detailed-accounts[
2506detailed accounts] is returned that describes the review of the
2507revision. The revision for which the review is retrieved is contained
2508in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05002509set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002510revision of the change. Please note that the returned labels are always
2511for the current patch set.
2512
2513.Response
2514----
2515 HTTP/1.1 200 OK
2516 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002517 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002518
2519 )]}'
2520 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002521 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2522 "project": "myProject",
2523 "branch": "master",
2524 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2525 "subject": "Implementing Feature X",
2526 "status": "NEW",
2527 "created": "2013-02-01 09:59:32.126000000",
2528 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002529 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01002530 "insertions": 34,
2531 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002532 "_number": 3965,
2533 "owner": {
2534 "_account_id": 1000096,
2535 "name": "John Doe",
2536 "email": "john.doe@example.com"
2537 },
2538 "labels": {
2539 "Verified": {
2540 "all": [
2541 {
2542 "value": 0,
2543 "_account_id": 1000096,
2544 "name": "John Doe",
2545 "email": "john.doe@example.com"
2546 },
2547 {
2548 "value": 0,
2549 "_account_id": 1000097,
2550 "name": "Jane Roe",
2551 "email": "jane.roe@example.com"
2552 }
2553 ],
2554 "values": {
2555 "-1": "Fails",
2556 " 0": "No score",
2557 "+1": "Verified"
2558 }
2559 },
2560 "Code-Review": {
2561 "all": [
2562 {
2563 "value": -1,
2564 "_account_id": 1000096,
2565 "name": "John Doe",
2566 "email": "john.doe@example.com"
2567 },
2568 {
2569 "value": 1,
2570 "_account_id": 1000097,
2571 "name": "Jane Roe",
2572 "email": "jane.roe@example.com"
2573 }
2574 ]
2575 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04002576 "-2": "This shall not be merged",
2577 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002578 " 0": "No score",
2579 "+1": "Looks good to me, but someone else must approve",
2580 "+2": "Looks good to me, approved"
2581 }
2582 }
2583 },
2584 "permitted_labels": {
2585 "Verified": [
2586 "-1",
2587 " 0",
2588 "+1"
2589 ],
2590 "Code-Review": [
2591 "-2",
2592 "-1",
2593 " 0",
2594 "+1",
2595 "+2"
2596 ]
2597 },
2598 "removable_reviewers": [
2599 {
2600 "_account_id": 1000096,
2601 "name": "John Doe",
2602 "email": "john.doe@example.com"
2603 },
2604 {
2605 "_account_id": 1000097,
2606 "name": "Jane Roe",
2607 "email": "jane.roe@example.com"
2608 }
2609 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08002610 "reviewers": {
2611 "REVIEWER": [
2612 {
2613 "_account_id": 1000096,
2614 "name": "John Doe",
2615 "email": "john.doe@example.com"
2616 },
2617 {
2618 "_account_id": 1000097,
2619 "name": "Jane Roe",
2620 "email": "jane.roe@example.com"
2621 }
2622 ]
2623 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002624 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
2625 "revisions": {
2626 "674ac754f91e64a0efb8087e59a176484bd534d1": {
2627 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01002628 "ref": "refs/changes/65/3965/2",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002629 "fetch": {
2630 "http": {
2631 "url": "http://gerrit/myProject",
2632 "ref": "refs/changes/65/3965/2"
2633 }
2634 }
2635 }
2636 }
2637----
2638
David Pursehouse669f2512014-07-18 11:41:42 +09002639[[get-related-changes]]
2640=== Get Related Changes
2641--
2642'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
2643--
2644
2645Retrieves related changes of a revision. Related changes are changes that either
2646depend on, or are dependencies of the revision.
2647
2648.Request
2649----
2650 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
2651----
2652
2653As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
2654describing the related changes.
2655
2656.Response
2657----
2658 HTTP/1.1 200 OK
2659 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002660 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09002661
2662 )]}'
2663 {
2664 "changes": [
2665 {
2666 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
2667 "commit": {
2668 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
2669 "parents": [
2670 {
2671 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
2672 }
2673 ],
2674 "author": {
2675 "name": "David Ostrovsky",
2676 "email": "david@ostrovsky.org",
2677 "date": "2014-07-12 15:04:24.000000000",
2678 "tz": 120
2679 },
2680 "subject": "Remove Solr"
2681 },
2682 "_change_number": 58478,
2683 "_revision_number": 2,
2684 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07002685 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09002686 },
2687 {
2688 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
2689 "commit": {
2690 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
2691 "parents": [
2692 {
2693 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
2694 }
2695 ],
2696 "author": {
2697 "name": "David Pursehouse",
2698 "email": "david.pursehouse@sonymobile.com",
2699 "date": "2014-06-24 02:01:28.000000000",
2700 "tz": 540
2701 },
2702 "subject": "Add support for secondary index with Elasticsearch"
2703 },
2704 "_change_number": 58081,
2705 "_revision_number": 10,
2706 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07002707 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09002708 }
2709 ]
2710 }
2711----
2712
2713
Edwin Kempin67498de2013-02-25 16:15:34 +01002714[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002715=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002716--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002717'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002718--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002719
Edwin Kempin67498de2013-02-25 16:15:34 +01002720Sets a review on a revision.
2721
2722The review must be provided in the request body as a
2723link:#review-input[ReviewInput] entity.
2724
2725.Request
2726----
2727 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002728 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01002729
2730 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01002731 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01002732 "message": "Some nits need to be fixed.",
2733 "labels": {
2734 "Code-Review": -1
2735 },
2736 "comments": {
2737 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2738 {
2739 "line": 23,
2740 "message": "[nit] trailing whitespace"
2741 },
2742 {
2743 "line": 49,
2744 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09002745 },
2746 {
2747 "range": {
2748 "start_line": 50,
2749 "start_character": 0,
2750 "end_line": 55,
2751 "end_character": 20
2752 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09002753 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01002754 }
2755 ]
2756 }
2757 }
2758----
2759
2760As response a link:#review-info[ReviewInfo] entity is returned that
2761describes the applied labels.
2762
2763.Response
2764----
2765 HTTP/1.1 200 OK
2766 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002767 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01002768
2769 )]}'
2770 {
2771 "labels": {
2772 "Code-Review": -1
2773 }
2774 }
2775----
2776
Edwin Kempind0febd32015-01-07 10:27:31 +01002777A review cannot be set on a change edit. Trying to post a review for a
2778change edit fails with `409 Conflict`.
2779
Edwin Kempincdae63b2013-03-15 15:06:59 +01002780[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002781=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002782--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002783'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002784--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002785
2786Rebases a revision.
2787
Zalan Blenessy874aed72015-01-12 13:26:18 +01002788Optionally, the parent revision can be changed to another patch set through the
2789link:#rebase-input[RebaseInput] entity.
2790
Edwin Kempincdae63b2013-03-15 15:06:59 +01002791.Request
2792----
2793 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01002794 Content-Type: application/json;charset=UTF-8
2795
2796 {
2797 "base" : "1234",
2798 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01002799----
2800
2801As response a link:#change-info[ChangeInfo] entity is returned that
2802describes the rebased change. Information about the current patch set
2803is included.
2804
2805.Response
2806----
2807 HTTP/1.1 200 OK
2808 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002809 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01002810
2811 )]}'
2812 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01002813 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
2814 "project": "myProject",
2815 "branch": "master",
2816 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
2817 "subject": "Implement Feature X",
2818 "status": "NEW",
2819 "created": "2013-02-01 09:59:32.126000000",
2820 "updated": "2013-02-21 11:16:36.775000000",
2821 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01002822 "insertions": 21,
2823 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01002824 "_number": 4799,
2825 "owner": {
2826 "name": "John Doe"
2827 },
2828 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
2829 "revisions": {
2830 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
2831 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01002832 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01002833 "fetch": {
2834 "http": {
2835 "url": "http://gerrit:8080/myProject",
2836 "ref": "refs/changes/99/4799/2"
2837 }
2838 },
2839 "commit": {
2840 "parents": [
2841 {
2842 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
2843 "subject": "Implement Feature A"
2844 }
2845 ],
2846 "author": {
2847 "name": "John Doe",
2848 "email": "john.doe@example.com",
2849 "date": "2013-05-07 15:21:27.000000000",
2850 "tz": 120
2851 },
2852 "committer": {
2853 "name": "Gerrit Code Review",
2854 "email": "gerrit-server@example.com",
2855 "date": "2013-05-07 15:35:43.000000000",
2856 "tz": 120
2857 },
2858 "subject": "Implement Feature X",
2859 "message": "Implement Feature X\n\nAdded feature X."
2860 }
2861 }
2862 }
2863----
2864
2865If the revision cannot be rebased, e.g. due to conflicts, the response is
2866"`409 Conflict`" and the error message is contained in the response
2867body.
2868
2869.Response
2870----
2871 HTTP/1.1 409 Conflict
2872 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002873 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01002874
2875 The change could not be rebased due to a path conflict during merge.
2876----
2877
Edwin Kempin14b58112013-02-26 16:30:19 +01002878[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002879=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002880--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002881'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002882--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002883
Edwin Kempin14b58112013-02-26 16:30:19 +01002884Submits a revision.
2885
Edwin Kempin14b58112013-02-26 16:30:19 +01002886.Request
2887----
2888 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002889 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01002890----
2891
2892As response a link:#submit-info[SubmitInfo] entity is returned that
2893describes the status of the submitted change.
2894
2895.Response
2896----
2897 HTTP/1.1 200 OK
2898 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002899 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01002900
2901 )]}'
2902 {
2903 "status": "MERGED"
2904 }
2905----
2906
2907If the revision cannot be submitted, e.g. because the submit rule
2908doesn't allow submitting the revision or the revision is not the
2909current revision, the response is "`409 Conflict`" and the error
2910message is contained in the response body.
2911
2912.Response
2913----
2914 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002915 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01002916
2917 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
2918----
2919
David Ostrovsky0d69c232013-09-10 23:10:23 +02002920[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002921=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002922--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002923'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002924--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002925
2926Publishes a draft revision.
2927
2928.Request
2929----
2930 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002931 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002932----
2933
2934.Response
2935----
2936 HTTP/1.1 204 No Content
2937----
2938
2939[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002940=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002941--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002942'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002943--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002944
2945Deletes a draft revision.
2946
2947.Request
2948----
2949 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002950 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002951----
2952
2953.Response
2954----
2955 HTTP/1.1 204 No Content
2956----
2957
Edwin Kempin257d70f2013-03-28 14:31:14 +01002958[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002959=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002960--
Edwin Kempin257d70f2013-03-28 14:31:14 +01002961'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002962--
Edwin Kempin257d70f2013-03-28 14:31:14 +01002963
2964Gets the formatted patch for one revision.
2965
2966.Request
2967----
2968 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
2969----
2970
Shawn Pearce98361f72013-05-10 16:27:36 -07002971The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01002972
2973.Response
2974----
2975 HTTP/1.1 200 OK
2976 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002977 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07002978 X-FYI-Content-Encoding: base64
2979 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01002980
Shawn Pearce98361f72013-05-10 16:27:36 -07002981 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01002982----
2983
David Ostrovsky973f38b2013-08-22 00:24:51 -07002984Adding query parameter `zip` (for example `/changes/.../patch?zip`)
2985returns the patch as a single file inside of a ZIP archive. Clients
2986can expand the ZIP to obtain the plain text patch, avoiding the
2987need for a base64 decoding step. This option implies `download`.
2988
2989Query parameter `download` (e.g. `/changes/.../patch?download`)
2990will suggest the browser save the patch as `commitsha1.diff.base64`,
2991for later processing by command line tools.
2992
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002993[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002994=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002995--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002996'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002997--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07002998
2999Gets the method the server will use to submit (merge) the change and
3000an indicator if the change is currently mergeable.
3001
3002.Request
3003----
3004 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
3005----
3006
Saša Živkov499873f2014-05-05 13:34:18 +02003007As response a link:#mergeable-info[MergeableInfo] entity is returned.
3008
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003009.Response
3010----
3011 HTTP/1.1 200 OK
3012 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003013 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003014
3015 )]}'
3016 {
3017 submit_type: "MERGE_IF_NECESSARY",
3018 mergeable: true,
3019 }
3020----
3021
Saša Živkov697cab22014-04-29 16:46:50 +02003022If the `other-branches` parameter is specified, the mergeability will also be
3023checked for all other branches.
3024
3025.Request
3026----
3027 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
3028----
3029
3030The response will then contain a list of all other branches where this changes
3031could merge cleanly.
3032
3033.Response
3034----
3035 HTTP/1.1 200 OK
3036 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003037 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02003038
3039 )]}'
3040 {
3041 submit_type: "MERGE_IF_NECESSARY",
3042 mergeable: true,
3043 mergeable_into: [
3044 "refs/heads/stable-2.7",
3045 "refs/heads/stable-2.8",
3046 ]
3047 }
3048----
3049
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003050[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003051=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003052--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003053'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003054--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003055
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003056Gets the method the server will use to submit (merge) the change.
3057
3058.Request
3059----
3060 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
3061----
3062
3063.Response
3064----
3065 HTTP/1.1 200 OK
3066 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003067 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003068
3069 )]}'
3070 "MERGE_IF_NECESSARY"
3071----
3072
3073[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003074=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003075--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003076'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003077--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003078
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003079Tests the submit_type Prolog rule in the project, or the one given.
3080
3081Request body may be either the Prolog code as `text/plain` or a
3082link:#rule-input[RuleInput] object. The query parameter `filters`
3083may be set to `SKIP` to bypass parent project filters while testing
3084a project-specific rule.
3085
3086.Request
3087----
3088 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003089 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003090
3091 submit_type(cherry_pick).
3092----
3093
3094.Response
3095----
3096 HTTP/1.1 200 OK
3097 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003098 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003099
3100 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07003101 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003102----
3103
3104[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003105=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003106--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003107'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003108--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003109
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003110Tests the submit_rule Prolog rule in the project, or the one given.
3111
3112Request body may be either the Prolog code as `text/plain` or a
3113link:#rule-input[RuleInput] object. The query parameter `filters`
3114may be set to `SKIP` to bypass parent project filters while testing
3115a project-specific rule.
3116
3117.Request
3118----
Shawn Pearcea3cce712014-03-21 08:16:11 -07003119 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003120 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003121
3122 submit_rule(submit(R)) :-
3123 R = label('Any-Label-Name', reject(_)).
3124----
3125
3126The response is a list of link:#submit-record[SubmitRecord] entries
3127describing the permutations that satisfy the tested submit rule.
3128
3129.Response
3130----
3131 HTTP/1.1 200 OK
3132 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003133 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003134
3135 )]}'
3136 [
3137 {
3138 "status": "NOT_READY",
3139 "reject": {
3140 "Any-Label-Name": {}
3141 }
3142 }
3143 ]
3144----
3145
Shawn Pearceb42e3032015-04-02 10:28:10 -07003146When testing with the `curl` command line client the
3147`--data-binary @rules.pl` flag should be used to ensure
3148all LFs are included in the Prolog code:
3149
3150----
3151 curl -X POST \
3152 -H 'Content-Type: text/plain; charset=UTF-8' \
3153 --data-binary @rules.pl \
3154 http://.../test.submit_rule
3155----
3156
Edwin Kempincb6724a2013-02-26 16:58:51 +01003157[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003158=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003159--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003160'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003161--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003162
Edwin Kempin3ca57192013-02-27 07:44:01 +01003163Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01003164user.
3165
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003166Returns a map of file paths to lists of link:#comment-info[CommentInfo]
3167entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003168
3169.Request
3170----
3171 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
3172----
3173
3174.Response
3175----
3176 HTTP/1.1 200 OK
3177 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003178 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01003179
3180 )]}'
3181 {
3182 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3183 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003184 "id": "TvcXrmjM",
3185 "line": 23,
3186 "message": "[nit] trailing whitespace",
3187 "updated": "2013-02-26 15:40:43.986000000"
3188 },
3189 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003190 "id": "TveXwFiA",
3191 "line": 49,
3192 "in_reply_to": "TfYX-Iuo",
3193 "message": "Done",
3194 "updated": "2013-02-26 15:40:45.328000000"
3195 }
3196 ]
3197 }
3198----
3199
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003200[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003201=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003202--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003203'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003204--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003205
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003206Creates a draft comment on a revision.
3207
3208The new draft comment must be provided in the request body inside a
3209link:#comment-input[CommentInput] entity.
3210
3211.Request
3212----
3213 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003214 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003215
3216 {
3217 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3218 "line": 23,
3219 "message": "[nit] trailing whitespace"
3220 }
3221----
3222
3223As response a link:#comment-info[CommentInfo] entity is returned that
3224describes the draft comment.
3225
3226.Response
3227----
3228 HTTP/1.1 200 OK
3229 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003230 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003231
3232 )]}'
3233 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003234 "id": "TvcXrmjM",
3235 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3236 "line": 23,
3237 "message": "[nit] trailing whitespace",
3238 "updated": "2013-02-26 15:40:43.986000000"
3239 }
3240----
3241
Edwin Kempin3ca57192013-02-27 07:44:01 +01003242[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003243=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003244--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003245'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003246--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003247
Edwin Kempin3ca57192013-02-27 07:44:01 +01003248Retrieves a draft comment of a revision that belongs to the calling
3249user.
3250
3251.Request
3252----
3253 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3254----
3255
3256As response a link:#comment-info[CommentInfo] entity is returned that
3257describes the draft comment.
3258
3259.Response
3260----
3261 HTTP/1.1 200 OK
3262 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003263 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01003264
3265 )]}'
3266 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01003267 "id": "TvcXrmjM",
3268 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3269 "line": 23,
3270 "message": "[nit] trailing whitespace",
3271 "updated": "2013-02-26 15:40:43.986000000"
3272 }
3273----
3274
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003275[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003276=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003277--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003278'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003279--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003280
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003281Updates a draft comment on a revision.
3282
3283The new draft comment must be provided in the request body inside a
3284link:#comment-input[CommentInput] entity.
3285
3286.Request
3287----
3288 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003289 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003290
3291 {
3292 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3293 "line": 23,
3294 "message": "[nit] trailing whitespace"
3295 }
3296----
3297
3298As response a link:#comment-info[CommentInfo] entity is returned that
3299describes the draft comment.
3300
3301.Response
3302----
3303 HTTP/1.1 200 OK
3304 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003305 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003306
3307 )]}'
3308 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003309 "id": "TvcXrmjM",
3310 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3311 "line": 23,
3312 "message": "[nit] trailing whitespace",
3313 "updated": "2013-02-26 15:40:43.986000000"
3314 }
3315----
3316
3317[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003318=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003319--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003320'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003321--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003322
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003323Deletes a draft comment from a revision.
3324
3325.Request
3326----
3327 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3328----
3329
3330.Response
3331----
3332 HTTP/1.1 204 No Content
3333----
3334
John Spurlock5e402f02013-03-24 11:35:04 -04003335[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003336=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003337--
John Spurlock5e402f02013-03-24 11:35:04 -04003338'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003339--
John Spurlock5e402f02013-03-24 11:35:04 -04003340
3341Lists the published comments of a revision.
3342
3343As result a map is returned that maps the file path to a list of
3344link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07003345sorted by file path and only include file (or inline) comments. Use
3346the link:#get-change-detail[Get Change Detail] endpoint to retrieve
3347the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04003348
3349.Request
3350----
3351 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
3352----
3353
3354.Response
3355----
3356 HTTP/1.1 200 OK
3357 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003358 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04003359
3360 )]}'
3361 {
3362 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3363 {
John Spurlock5e402f02013-03-24 11:35:04 -04003364 "id": "TvcXrmjM",
3365 "line": 23,
3366 "message": "[nit] trailing whitespace",
3367 "updated": "2013-02-26 15:40:43.986000000",
3368 "author": {
3369 "_account_id": 1000096,
3370 "name": "John Doe",
3371 "email": "john.doe@example.com"
3372 }
3373 },
3374 {
John Spurlock5e402f02013-03-24 11:35:04 -04003375 "id": "TveXwFiA",
3376 "line": 49,
3377 "in_reply_to": "TfYX-Iuo",
3378 "message": "Done",
3379 "updated": "2013-02-26 15:40:45.328000000",
3380 "author": {
3381 "_account_id": 1000097,
3382 "name": "Jane Roe",
3383 "email": "jane.roe@example.com"
3384 }
3385 }
3386 ]
3387 }
3388----
3389
3390[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003391=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003392--
John Spurlock5e402f02013-03-24 11:35:04 -04003393'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003394--
John Spurlock5e402f02013-03-24 11:35:04 -04003395
3396Retrieves a published comment of a revision.
3397
3398.Request
3399----
3400 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
3401----
3402
3403As response a link:#comment-info[CommentInfo] entity is returned that
3404describes the published comment.
3405
3406.Response
3407----
3408 HTTP/1.1 200 OK
3409 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003410 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04003411
3412 )]}'
3413 {
John Spurlock5e402f02013-03-24 11:35:04 -04003414 "id": "TvcXrmjM",
3415 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3416 "line": 23,
3417 "message": "[nit] trailing whitespace",
3418 "updated": "2013-02-26 15:40:43.986000000",
3419 "author": {
3420 "_account_id": 1000096,
3421 "name": "John Doe",
3422 "email": "john.doe@example.com"
3423 }
3424 }
3425----
3426
Edwin Kempin682ac712013-05-14 13:40:46 +02003427[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003428=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003429--
Edwin Kempin682ac712013-05-14 13:40:46 +02003430'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003431--
Edwin Kempin682ac712013-05-14 13:40:46 +02003432
3433Lists the files that were modified, added or deleted in a revision.
3434
3435.Request
3436----
3437 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
3438----
3439
3440As result a map is returned that maps the file path to a list of
3441link:#file-info[FileInfo] entries. The entries in the map are
3442sorted by file path.
3443
3444.Response
3445----
3446 HTTP/1.1 200 OK
3447 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003448 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02003449
3450 )]}'
3451 {
3452 "/COMMIT_MSG": {
3453 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02003454 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01003455 "size_delta": 551,
3456 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02003457 },
3458 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
3459 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02003460 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01003461 "size_delta": 98,
3462 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02003463 }
3464 }
3465----
3466
Shawn Pearce984747d2013-07-18 00:42:16 -07003467The request parameter `reviewed` changes the response to return a list
3468of the paths the caller has marked as reviewed. Clients that also
3469need the FileInfo should make two requests.
3470
Shawn Pearce8ca03a62015-01-02 22:03:20 -08003471The request parameter `q` changes the response to return a list
3472of all files (modified or unmodified) that contain that substring
3473in the path name. This is useful to implement suggestion services
3474finding a file by partial name.
3475
Shawn Pearce984747d2013-07-18 00:42:16 -07003476.Request
3477----
3478 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
3479----
3480
3481.Response
3482----
3483 HTTP/1.1 200 OK
3484 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003485 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07003486
3487 )]}'
3488 [
3489 "/COMMIT_MSG",
3490 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3491 ]
3492----
3493
Edwin Kempinaef44b02013-05-07 16:15:55 +02003494[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003495=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003496--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003497'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003498--
Edwin Kempinaef44b02013-05-07 16:15:55 +02003499
3500Gets the content of a file from a certain revision.
3501
3502.Request
3503----
3504 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
3505----
3506
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003507The content is returned as base64 encoded string. The HTTP response
3508Content-Type is always `text/plain`, reflecting the base64 wrapping.
3509A Gerrit-specific `X-FYI-Content-Type` header is returned describing
3510the server detected content type of the file.
3511
3512If only the content type is required, callers should use HEAD to
3513avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02003514
3515.Response
3516----
3517 HTTP/1.1 200 OK
3518 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003519 Content-Type: text/plain; charset=ISO-8859-1
3520 X-FYI-Content-Encoding: base64
3521 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02003522
3523 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
3524----
3525
David Ostrovskyd0078672015-02-06 21:51:04 +01003526Alternatively, if the only value of the Accept request header is
3527`application/json` the content is returned as JSON string and
3528`X-FYI-Content-Encoding` is set to `json`.
3529
David Pletcherd1efb452015-09-01 17:45:55 -07003530[[get-safe-content]]
3531=== Download Content
3532--
3533'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
3534--
3535
3536Downloads the content of a file from a certain revision, in a safe format
3537that poses no risk for inadvertent execution of untrusted code.
3538
3539If the content type is defined as safe, the binary file content is returned
3540verbatim. If the content type is not safe, the file is stored inside a ZIP
3541file, containing a single entry with a random, unpredictable name having the
3542same base and suffix as the true filename. The ZIP file is returned in
3543verbatim binary form.
3544
3545See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
3546for information about safe file type configuration.
3547
3548The HTTP resource Content-Type is dependent on the file type: the
3549applicable type for safe files, or "application/zip" for unsafe files.
3550
David Pletcherec622bf2015-09-18 14:30:05 -07003551The optional, integer-valued `parent` parameter can be specified to request
3552the named file from a parent commit of the specified revision. The value is
3553the 1-based index of the parent's position in the commit object. If the
3554parameter is omitted or the value non-positive, the patch set is referenced.
3555
3556Filenames are decorated with a suffix of `_new` for the current patch,
3557`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07003558
3559.Request
3560----
3561 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/safe_content HTTP/1.0
3562----
3563
3564.Response
3565----
3566 HTTP/1.1 200 OK
3567 Content-Disposition: attachment; filename="logo.png"
3568 Content-Type: image/png
3569
3570 `[binary data for logo.png]`
3571----
3572
3573.Request
3574----
3575 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/safe_content?suffix=new HTTP/1.0
3576----
3577
3578.Response
3579----
3580 HTTP/1.1 200 OK
3581 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
3582 Content-Type:application/zip
3583
3584 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
3585----
3586
David Pursehouse882aef22013-06-05 10:56:37 +09003587[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003588=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003589--
David Pursehouse882aef22013-06-05 10:56:37 +09003590'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003591--
David Pursehouse882aef22013-06-05 10:56:37 +09003592
3593Gets the diff of a file from a certain revision.
3594
3595.Request
3596----
3597 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
3598----
3599
3600As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
3601
3602.Response
3603----
3604 HTTP/1.1 200 OK
3605 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003606 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003607
3608 )]
3609 {
3610 "meta_a": {
3611 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003612 "content_type": "text/x-java-source",
3613 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09003614 },
3615 "meta_b": {
3616 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003617 "content_type": "text/x-java-source",
3618 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003619 },
3620 "change_type": "MODIFIED",
3621 "diff_header": [
3622 "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3623 "index 59b7670..9faf81c 100644",
3624 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3625 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
3626 ],
3627 "content": [
3628 {
3629 "ab": [
3630 "// Copyright (C) 2010 The Android Open Source Project",
3631 "//",
3632 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
3633 "// you may not use this file except in compliance with the License.",
3634 "// You may obtain a copy of the License at",
3635 "//",
3636 "// http://www.apache.org/licenses/LICENSE-2.0",
3637 "//",
3638 "// Unless required by applicable law or agreed to in writing, software",
3639 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
3640 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
3641 "// See the License for the specific language governing permissions and",
3642 "// limitations under the License."
3643 ]
3644 },
3645 {
3646 "b": [
3647 "//",
3648 "// Add some more lines in the header."
3649 ]
3650 },
3651 {
3652 "ab": [
3653 "",
3654 "package com.google.gerrit.server.project;",
3655 "",
3656 "import com.google.common.collect.Maps;",
3657 ...
3658 ]
3659 }
3660 ...
3661 ]
3662 }
3663----
3664
3665If the `intraline` parameter is specified, intraline differences are included in the diff.
3666
3667.Request
3668----
3669 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?intraline HTTP/1.0
3670----
3671
3672.Response
3673----
3674 HTTP/1.1 200 OK
3675 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003676 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003677
3678 )]
3679 {
3680 "meta_a": {
3681 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003682 "content_type": "text/x-java-source",
3683 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09003684 },
3685 "meta_b": {
3686 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003687 "content_type": "text/x-java-source",
3688 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003689 },
3690 "change_type": "MODIFIED",
3691 "diff_header": [
3692 "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3693 "index 59b7670..9faf81c 100644",
3694 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3695 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
3696 ],
3697 "content": [
3698 ...
3699 {
3700 "a": [
3701 "/** Manages access control for Git references (aka branches, tags). */"
3702 ],
3703 "b": [
3704 "/** Manages access control for the Git references (aka branches, tags). */"
3705 ],
3706 "edit_a": [],
3707 "edit_b": [
3708 [
3709 31,
3710 4
3711 ]
3712 ]
3713 }
3714 ]
3715 }
3716----
3717
3718The `base` parameter can be specified to control the base patch set from which the diff should
3719be generated.
3720
Edwin Kempin8cdce502014-12-06 10:55:38 +01003721[[weblinks-only]]
3722If the `weblinks-only` parameter is specified, only the diff web links are returned.
3723
David Pursehouse882aef22013-06-05 10:56:37 +09003724.Request
3725----
3726 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?base=2 HTTP/1.0
3727----
3728
3729.Response
3730----
3731 HTTP/1.1 200 OK
3732 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003733 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003734
3735 )]
3736 {
3737 "meta_a": {
3738 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003739 "content_type": "text/x-java-source",
3740 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003741 },
3742 "meta_b": {
3743 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003744 "content_type": "text/x-java-source",
3745 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003746 },
3747 "change_type": "MODIFIED",
3748 "content": [
3749 {
3750 "skip": 578
3751 }
3752 ]
3753 }
3754----
3755
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01003756The `whitespace` parameter can be specified to control how whitespace
3757differences are reported in the result. Valid values are `IGNORE_NONE`,
3758`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09003759
3760The `context` parameter can be specified to control the number of lines of surrounding context
3761in the diff. Valid values are `ALL` or number of lines.
3762
Gabor Somossyb72d4c62015-10-20 23:40:07 +01003763[[get-blame]]
3764=== Get Blame
3765--
3766'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
3767--
3768
3769Gets the blame of a file from a certain revision.
3770
3771.Request
3772----
3773 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
3774----
3775
3776As response a link:#blame-info[BlameInfo] entity is returned that describes the
3777blame.
3778
3779.Response
3780----
3781 HTTP/1.1 200 OK
3782 Content-Disposition: attachment
3783 Content-Type: application/json; charset=UTF-8
3784
3785 )]
3786 {
3787 [
3788 {
3789 "author": "Joe Daw",
3790 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
3791 "time": 1421441349,
3792 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
3793 "ranges": [
3794 {
3795 "start": 1,
3796 "end": 10
3797 },
3798 {
3799 "start": 16,
3800 "end": 296
3801 }
3802 ]
3803 },
3804 {
3805 "author": "Jane Daw",
3806 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
3807 "time": 1421825421,
3808 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
3809 "ranges": [
3810 {
3811 "start": 13,
3812 "end": 13
3813 }
3814 ]
3815 }
3816 ]
3817 }
3818----
3819
3820The `base` parameter can be specified to control the base patch set from which
3821the blame should be generated.
3822
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003823[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003824=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003825--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003826'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003827--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003828
Edwin Kempinbea55a52013-05-14 13:53:39 +02003829Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003830
3831.Request
3832----
3833 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
3834----
3835
3836.Response
3837----
3838 HTTP/1.1 201 Created
3839----
3840
Edwin Kempinbea55a52013-05-14 13:53:39 +02003841If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003842response is "`200 OK`".
3843
3844[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003845=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003846--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003847'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003848--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003849
Edwin Kempinbea55a52013-05-14 13:53:39 +02003850Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003851
3852.Request
3853----
3854 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
3855----
3856
3857.Response
3858----
3859 HTTP/1.1 204 No Content
3860----
3861
Gustaf Lundh019fb262012-11-28 14:20:22 +01003862[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003863=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003864--
Gustaf Lundh019fb262012-11-28 14:20:22 +01003865'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003866--
Gustaf Lundh019fb262012-11-28 14:20:22 +01003867
3868Cherry picks a revision to a destination branch.
3869
3870The commit message and destination branch must be provided in the request body inside a
3871link:#cherrypick-input[CherryPickInput] entity.
3872
3873.Request
3874----
3875 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003876 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01003877
3878 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01003879 "message" : "Implementing Feature X",
3880 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01003881 }
3882----
3883
3884As response a link:#change-info[ChangeInfo] entity is returned that
3885describes the resulting cherry picked change.
3886
3887.Response
3888----
3889 HTTP/1.1 200 OK
3890 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003891 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01003892
3893 )]}'
3894 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01003895 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
3896 "project": "myProject",
3897 "branch": "release-branch",
3898 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
3899 "subject": "Implementing Feature X",
3900 "status": "NEW",
3901 "created": "2013-02-01 09:59:32.126000000",
3902 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01003903 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003904 "insertions": 12,
3905 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01003906 "_number": 3965,
3907 "owner": {
3908 "name": "John Doe"
3909 }
3910 }
3911----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003912
3913[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003914== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003915
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003916[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003917=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003918--
3919--
3920
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003921[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003922=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003923Identifier that uniquely identifies one change.
3924
3925This can be:
3926
3927* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
3928 where for the branch the `refs/heads/` prefix can be omitted
3929 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
3930* a Change-Id if it uniquely identifies one change
3931 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
3932* a legacy numeric change ID ("4247")
3933
John Spurlock5e402f02013-03-24 11:35:04 -04003934[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003935=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04003936UUID of a published comment.
3937
Edwin Kempin3ca57192013-02-27 07:44:01 +01003938[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003939=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01003940UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01003941
David Ostrovskybeb0b842014-12-13 00:24:29 +01003942[[label-id]]
3943=== \{label-id\}
3944The name of the label.
3945
Edwin Kempinbea55a52013-05-14 13:53:39 +02003946[[file-id]]
3947\{file-id\}
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003948~~~~~~~~~~~~
Edwin Kempinbea55a52013-05-14 13:53:39 +02003949The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01003950
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003951[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003952=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003953Identifier that uniquely identifies one revision of a change.
3954
3955This can be:
3956
Shawn Pearce9c0722a2013-03-02 15:30:31 -08003957* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003958* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
3959* an abbreviated commit ID that uniquely identifies one revision of the
3960 change ("674ac754"), at least 4 digits are required
3961* a legacy numeric patch number ("1" for first patch set of the change)
3962
Edwin Kempine3446292013-02-19 16:40:14 +01003963[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003964== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01003965
Edwin Kempined5364b2013-02-22 10:39:33 +01003966[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003967=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01003968The `AbandonInput` entity contains information for abandoning a change.
3969
David Pursehouseae367192014-11-25 17:24:47 +09003970[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01003971|===========================
3972|Field Name ||Description
3973|`message` |optional|
3974Message to be added as review comment to the change when abandoning the
3975change.
3976|===========================
3977
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003978[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003979=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003980The `ActionInfo` entity describes a REST API call the client can
3981make to manipulate a resource. These are frequently implemented by
3982plugins and may be discovered at runtime.
3983
David Pursehouseae367192014-11-25 17:24:47 +09003984[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07003985|====================================
3986|Field Name ||Description
3987|`method` |optional|
3988HTTP method to use with the action. Most actions use `POST`, `PUT`
3989or `DELETE` to cause state changes.
3990|`label` |optional|
3991Short title to display to a user describing the action. In the
3992Gerrit web interface the label is used as the text on the button
3993presented in the UI.
3994|`title` |optional|
3995Longer text to display describing the action. In a web UI this
3996should be the title attribute of the element, displaying when
3997the user hovers the mouse.
3998|`enabled` |optional|
3999If true the action is permitted at this time and the caller is
4000likely allowed to execute it. This may change if state is updated
4001at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004002|====================================
4003
Edwin Kempin392328e2013-02-25 12:50:03 +01004004[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004005=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01004006The `AddReviewerResult` entity describes the result of adding a
4007reviewer to a change.
4008
David Pursehouseae367192014-11-25 17:24:47 +09004009[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01004010|===========================
4011|Field Name ||Description
4012|`reviewers` |optional|
4013The newly added reviewers as a list of link:#reviewer-info[
4014ReviewerInfo] entities.
4015|`error` |optional|
4016Error message explaining why the reviewer could not be added. +
4017If a group was specified in the input and an error is returned, it
4018means that none of the members were added as reviewer.
4019|`confirm` |`false` if not set|
4020Whether adding the reviewer requires confirmation.
4021|===========================
4022
Edwin Kempine3446292013-02-19 16:40:14 +01004023[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004024=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004025The `ApprovalInfo` entity contains information about an approval from a
4026user for a label on a change.
4027
Edwin Kempin963dfd02013-02-27 12:39:32 +01004028`ApprovalInfo` has the same fields as
4029link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01004030In addition `ApprovalInfo` has the following fields:
4031
David Pursehouseae367192014-11-25 17:24:47 +09004032[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004033|===========================
4034|Field Name ||Description
Dave Borowitza30db912013-03-22 14:20:33 -07004035|`value` |optional|
4036The vote that the user has given for the label. If present and zero, the
4037user is permitted to vote on the label. If absent, the user is not
4038permitted to vote on that label.
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01004039|`date` |optional|
4040The time and date describing when the approval was made.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004041|`tag` |optional|
4042Value of the `tag` field from link:#review-input[ReviewInput] set
4043while posting the review.
4044NOTE: To apply different tags on on different votes/comments multiple
4045invocations of the REST call are required.
Edwin Kempine3446292013-02-19 16:40:14 +01004046|===========================
4047
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004048[[blame-info]]
4049=== BlameInfo
4050The `BlameInfo` entity stores the commit metadata with the row coordinates where
4051it applies.
4052
4053[options="header",cols="1,6"]
4054|===========================
4055|Field Name | Description
4056|`author` | The author of the commit.
4057|`id` | The id of the commit.
4058|`time` | Commit time.
4059|`commit_msg` | The commit message.
4060|`ranges` |
4061The blame row coordinates as link:#range-info[RangeInfo] entities.
4062|===========================
4063
Edwin Kempin521c1242015-01-23 12:44:44 +01004064[[change-edit-input]]
4065=== ChangeEditInput
4066The `ChangeEditInput` entity contains information for restoring a
4067path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004068
Edwin Kempin521c1242015-01-23 12:44:44 +01004069[options="header",cols="1,^1,5"]
4070|===========================
4071|Field Name ||Description
4072|`restore_path`|optional|Path to file to restore.
4073|`old_path` |optional|Old path to file to rename.
4074|`new_path` |optional|New path to file to rename.
4075|===========================
4076
4077[[change-edit-message-input]]
4078=== ChangeEditMessageInput
4079The `ChangeEditMessageInput` entity contains information for changing
4080the commit message within a change edit.
4081
4082[options="header",cols="1,^1,5"]
4083|===========================
4084|Field Name ||Description
4085|`message` ||New commit message.
4086|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004087
Edwin Kempine3446292013-02-19 16:40:14 +01004088[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004089=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004090The `ChangeInfo` entity contains information about a change.
4091
David Pursehouseae367192014-11-25 17:24:47 +09004092[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004093|==================================
4094|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004095|`id` ||
4096The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05004097where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01004098`refs/heads/` prefix is omitted.
4099|`project` ||The name of the project.
4100|`branch` ||
4101The name of the target branch. +
4102The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01004103|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01004104|`change_id` ||The Change-Id of the change.
4105|`subject` ||
4106The subject of the change (header line of the commit message).
4107|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07004108The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01004109|`created` ||
4110The link:rest-api.html#timestamp[timestamp] of when the change was
4111created.
4112|`updated` ||
4113The link:rest-api.html#timestamp[timestamp] of when the change was last
4114updated.
Khai Do96a7caf2016-01-07 14:07:54 -08004115|`submitted` |only set for merged changes|
4116The link:rest-api.html#timestamp[timestamp] of when the change was
4117submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01004118|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02004119Whether the calling user has starred this change with the default label.
4120|`stars` |optional|
4121A list of star labels that are applied by the calling user to this
4122change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01004123|`reviewed` |not set if `false`|
4124Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07004125Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05004126|`submit_type` |optional|
4127The link:project-configuration.html#submit_type[submit type] of the change. +
4128Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01004129|`mergeable` |optional|
4130Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07004131Not set for merged changes, or if the change has not yet been tested.
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004132|`insertions` ||
4133Number of inserted lines.
4134|`deletions` ||
4135Number of deleted lines.
Edwin Kempine3446292013-02-19 16:40:14 +01004136|`_number` ||The legacy numeric ID of the change.
4137|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01004138The owner of the change as an link:rest-api-accounts.html#account-info[
4139AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07004140|`actions` |optional|
4141Actions the caller might be able to perform on this revision. The
4142information is a map of view name to link:#action-info[ActionInfo]
4143entities.
Edwin Kempine3446292013-02-19 16:40:14 +01004144|`labels` |optional|
4145The labels of the change as a map that maps the label names to
4146link:#label-info[LabelInfo] entries. +
4147Only set if link:#labels[labels] or link:#detailed-labels[detailed
4148labels] are requested.
4149|`permitted_labels` |optional|
4150A map of the permitted labels that maps a label name to the list of
4151values that are allowed for that label. +
4152Only set if link:#detailed-labels[detailed labels] are requested.
4153|`removable_reviewers`|optional|
4154The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01004155link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01004156Only set if link:#detailed-labels[detailed labels] are requested.
Edwin Kempin66af3d82015-11-10 17:38:40 -08004157|`reviewers` ||
4158The reviewers as a map that maps a reviewer state to a list of
4159link:rest-api-accounts.html#account-info[AccountInfo] entities.
4160Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
4161`REVIEWER`: Users with at least one non-zero vote on the change. +
4162`CC`: Users that were added to the change, but have not voted. +
4163`REMOVED`: Users that were previously reviewers on the change, but have
4164been removed. +
4165Only set if link:#detailed-labels[detailed labels] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04004166|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07004167Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04004168link:#change-message-info[ChangeMessageInfo] entities. +
4169Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004170|`current_revision` |optional|
4171The commit ID of the current patch set of this change. +
4172Only set if link:#current-revision[the current revision] is requested
4173or if link:#all-revisions[all revisions] are requested.
4174|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05004175All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01004176patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08004177Only set if link:#current-revision[the current revision] is requested
4178(in which case it will only contain a key for the current revision) or
4179if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004180|`_more_changes` |optional, not set if `false`|
4181Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08004182Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05004183|`problems` |optional|
4184A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08004185problems with this change. Only set if link:#check[CHECK] is set.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08004186|==================================
4187
4188[[change-input]]
4189=== ChangeInput
4190The `ChangeInput` entity contains information about creating a new change.
4191
4192[options="header",cols="1,^1,5"]
4193|==================================
4194|Field Name ||Description
4195|`project` ||The name of the project.
4196|`branch` ||
4197The name of the target branch. +
4198The `refs/heads/` prefix is omitted.
4199|`subject` ||
4200The subject of the change (header line of the commit message).
4201|`topic` |optional|The topic to which this change belongs.
4202|`status` |optional, default to `NEW`|
4203The status of the change (only `NEW` and `DRAFT` accepted here).
David Ostrovsky9d8ec422014-12-24 00:52:09 +01004204|`base_change` |optional|
4205A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08004206change operation.
4207|`new_branch` |optional, default to `false`|
4208Allow creating a new branch when set to `true`.
Edwin Kempine3446292013-02-19 16:40:14 +01004209|==================================
4210
John Spurlock74a70cc2013-03-23 16:41:50 -04004211[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004212=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04004213The `ChangeMessageInfo` entity contains information about a message
4214attached to a change.
4215
David Pursehouseae367192014-11-25 17:24:47 +09004216[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04004217|==================================
4218|Field Name ||Description
4219|`id` ||The ID of the message.
4220|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07004221Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04004222link:rest-api-accounts.html#account-info[AccountInfo] entity. +
4223Unset if written by the Gerrit system.
4224|`date` ||
4225The link:rest-api.html#timestamp[timestamp] this message was posted.
4226|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004227|`tag` |optional|
4228Value of the `tag` field from link:#review-input[ReviewInput] set
4229while posting the review.
4230NOTE: To apply different tags on on different votes/comments multiple
4231invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04004232|`_revision_number` |optional|
4233Which patchset (if any) generated this message.
4234|==================================
4235
Gustaf Lundh019fb262012-11-28 14:20:22 +01004236[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004237=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01004238The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
4239
David Pursehouseae367192014-11-25 17:24:47 +09004240[options="header",cols="1,6"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01004241|===========================
4242|Field Name |Description
4243|`message` |Commit message for the cherry-picked change
David Ostrovsky9345ebc2014-04-28 23:19:55 +02004244|`destination` |Destination branch
Gustaf Lundh019fb262012-11-28 14:20:22 +01004245|===========================
4246
Edwin Kempincb6724a2013-02-26 16:58:51 +01004247[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004248=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05004249The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004250
David Pursehouseae367192014-11-25 17:24:47 +09004251[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01004252|===========================
4253|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004254|`patch_set` |optional|
4255The patch set number for the comment; only set in contexts where +
4256comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04004257|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004258|`path` |optional|
4259The path of the file for which the inline comment was done. +
4260Not set if returned in a map where the key is the file path.
4261|`side` |optional|
4262The side on which the comment was added. +
4263Allowed values are `REVISION` and `PARENT`. +
4264If not set, the default is `REVISION`.
4265|`line` |optional|
4266The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04004267If range is set, this equals the end line of the range. +
4268If neither line nor range is set, it's a file comment.
4269|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09004270The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04004271entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004272|`in_reply_to` |optional|
4273The URL encoded UUID of the comment to which this comment is a reply.
4274|`message` |optional|The comment message.
4275|`updated` ||
4276The link:rest-api.html#timestamp[timestamp] of when this comment was
4277written.
John Spurlock5e402f02013-03-24 11:35:04 -04004278|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09004279The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04004280link:rest-api-accounts.html#account-info[AccountInfo] entity. +
4281Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004282|`tag` |optional|
4283Value of the `tag` field from link:#review-input[ReviewInput] set
4284while posting the review.
4285NOTE: To apply different tags on on different votes/comments multiple
4286invocations of the REST call are required.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004287|===========================
4288
Edwin Kempin67498de2013-02-25 16:15:34 +01004289[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004290=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03004291The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01004292comment.
4293
David Pursehouseae367192014-11-25 17:24:47 +09004294[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01004295|===========================
4296|Field Name ||Description
4297|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01004298The URL encoded UUID of the comment if an existing draft comment should
4299be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004300|`path` |optional|
4301The path of the file for which the inline comment should be added. +
4302Doesn't need to be set if contained in a map where the key is the file
4303path.
Edwin Kempin67498de2013-02-25 16:15:34 +01004304|`side` |optional|
4305The side on which the comment should be added. +
4306Allowed values are `REVISION` and `PARENT`. +
4307If not set, the default is `REVISION`.
4308|`line` |optional|
4309The number of the line for which the comment should be added. +
4310`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04004311If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09004312If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04004313|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09004314The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04004315entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01004316|`in_reply_to` |optional|
4317The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004318|`updated` |optional|
4319The link:rest-api.html#timestamp[timestamp] of this comment. +
4320Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01004321|`message` |optional|
4322The comment message. +
4323If not set and an existing draft comment is updated, the existing draft
4324comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04004325|`tag` |optional, drafts only|
4326Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
4327inputs; for published comments, use the `tag` field in +
4328link#review-input[ReviewInput]
Edwin Kempin67498de2013-02-25 16:15:34 +01004329|===========================
4330
Michael Zhou596c7682013-08-25 05:43:34 -04004331[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004332=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04004333The `CommentRange` entity describes the range of an inline comment.
4334
David Pursehouseae367192014-11-25 17:24:47 +09004335[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04004336|===========================
4337|Field Name ||Description
4338|`start_line` ||The start line number of the range.
4339|`start_character` ||The character position in the start line.
4340|`end_line` ||The end line number of the range.
4341|`end_character` ||The character position in the end line.
4342|===========================
4343
Edwin Kempine3446292013-02-19 16:40:14 +01004344[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004345=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004346The `CommitInfo` entity contains information about a commit.
4347
Edwin Kempinf0c57152015-07-15 18:18:24 +02004348[options="header",cols="1,^1,5"]
4349|===========================
4350|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02004351|`commit` |Optional|
4352The commit ID. Not set if included in a link:#revision-info[
4353RevisionInfo] entity that is contained in a map which has the commit ID
4354as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004355|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01004356The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02004357link:#commit-info[CommitInfo] entities. In each parent
4358only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004359|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01004360link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004361|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01004362link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004363|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01004364The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02004365|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01004366|`web_links` |optional|
4367Links to the commit in external sites as a list of
4368link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004369|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01004370
David Pursehouse882aef22013-06-05 10:56:37 +09004371[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004372=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09004373The `DiffContent` entity contains information about the content differences
4374in a file.
4375
David Pursehouseae367192014-11-25 17:24:47 +09004376[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004377|==========================
4378|Field Name ||Description
4379|`a` |optional|Content only in the file on side A (deleted in B).
4380|`b` |optional|Content only in the file on side B (added in B).
4381|`ab` |optional|Content in the file on both sides (unchanged).
4382|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
4383Text sections deleted from side A as a
4384link:#diff-intraline-info[DiffIntralineInfo] entity.
4385|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
4386Text sections inserted in side B as a
4387link:#diff-intraline-info[DiffIntralineInfo] entity.
4388|`skip` |optional|count of lines skipped on both sides when the file is
4389too large to include all common lines.
Shawn Pearce425a2be2014-01-02 16:00:58 -08004390|`common` |optional|Set to `true` if the region is common according
4391to the requested ignore-whitespace parameter, but a and b contain
4392differing amounts of whitespace. When present and true a and b are
4393used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09004394|==========================
4395
4396[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004397=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004398The `DiffFileMetaInfo` entity contains meta information about a file diff.
4399
David Pursehouseae367192014-11-25 17:24:47 +09004400[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004401|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02004402|Field Name ||Description
4403|`name` ||The name of the file.
4404|`content_type`||The content type of the file.
4405|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01004406|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02004407Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07004408link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09004409|==========================
4410
4411[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004412=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004413The `DiffInfo` entity contains information about the diff of a file
4414in a revision.
4415
Edwin Kempin8cdce502014-12-06 10:55:38 +01004416If the link:#weblinks-only[weblinks-only] parameter is specified, only
4417the `web_links` field is set.
4418
David Pursehouseae367192014-11-25 17:24:47 +09004419[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004420|==========================
4421|Field Name ||Description
4422|`meta_a` |not present when the file is added|
4423Meta information about the file on side A as a
4424link:#diff-file-meta-info[DiffFileMetaInfo] entity.
4425|`meta_b` |not present when the file is deleted|
4426Meta information about the file on side B as a
4427link:#diff-file-meta-info[DiffFileMetaInfo] entity.
4428|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
4429`COPIED`, `REWRITE`).
4430|`intraline_status`|only set when the `intraline` parameter was specified in the request|
4431Intraline status (`OK`, `ERROR`, `TIMEOUT`).
4432|`diff_header` ||A list of strings representing the patch set diff header.
4433|`content` ||The content differences in the file as a list of
4434link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01004435|`web_links` |optional|
4436Links to the file diff in external sites as a list of
4437link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01004438|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09004439|==========================
4440
4441[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004442=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004443The `DiffIntralineInfo` entity contains information about intraline edits in a
4444file.
4445
David Pursehouse31203f52013-06-08 17:05:45 +09004446The information consists of a list of `<skip length, mark length>` pairs, where
4447the skip length is the number of characters between the end of the previous edit
4448and the start of this edit, and the mark length is the number of edited characters
4449following the skip. The start of the edits is from the beginning of the related
4450diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09004451
David Pursehouse31203f52013-06-08 17:05:45 +09004452Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07004453the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09004454
Edwin Kempin8cdce502014-12-06 10:55:38 +01004455[[diff-web-link-info]]
4456=== DiffWebLinkInfo
4457The `DiffWebLinkInfo` entity describes a link on a diff screen to an
4458external site.
4459
4460[options="header",cols="1,6"]
4461|=======================
4462|Field Name|Description
4463|`name` |The link name.
4464|`url` |The link URL.
4465|`image_url`|URL to the icon of the link.
4466|show_on_side_by_side_diff_view|
4467Whether the web link should be shown on the side-by-side diff screen.
4468|show_on_unified_diff_view|
4469Whether the web link should be shown on the unified diff screen.
4470|=======================
4471
David Ostrovsky9ea9c112015-01-25 00:12:38 +01004472[[edit-file-info]]
4473=== EditFileInfo
4474The `EditFileInfo` entity contains additional information
4475of a file within a change edit.
4476
4477[options="header",cols="1,^1,5"]
4478|===========================
4479|Field Name ||Description
4480|`web_links` |optional|
4481Links to the diff info in external sites as a list of
4482link:#web-link-info[WebLinkInfo] entities.
4483|===========================
4484
Edwin Kempin521c1242015-01-23 12:44:44 +01004485[[edit-info]]
4486=== EditInfo
4487The `EditInfo` entity contains information about a change edit.
4488
4489[options="header",cols="1,^1,5"]
4490|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04004491|Field Name ||Description
4492|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01004493link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04004494|`base_revision`||The revision of the patch set the change edit is based on.
4495|`fetch` ||
Edwin Kempin521c1242015-01-23 12:44:44 +01004496Information about how to fetch this patch set. The fetch information is
4497provided as a map that maps the protocol name ("`git`", "`http`",
4498"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04004499|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01004500The files of the change edit as a map that maps the file names to
4501link:#file-info[FileInfo] entities.
4502|===========================
4503
Edwin Kempine3446292013-02-19 16:40:14 +01004504[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004505=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004506The `FetchInfo` entity contains information about how to fetch a patch
4507set via a certain protocol.
4508
David Pursehouseae367192014-11-25 17:24:47 +09004509[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004510|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02004511|Field Name ||Description
4512|`url` ||The URL of the project.
4513|`ref` ||The ref of the patch set.
4514|`commands` |optional|
4515The download commands for this patch set as a map that maps the command
4516names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09004517Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004518|==========================
4519
4520[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004521=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004522The `FileInfo` entity contains information about a file in a patch set.
4523
David Pursehouseae367192014-11-25 17:24:47 +09004524[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004525|=============================
4526|Field Name ||Description
4527|`status` |optional|
4528The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
4529"`C`"=Copied, "`W`"=Rewritten). +
4530Not set if the file was Modified ("`M`").
4531|`binary` |not set if `false`|Whether the file is binary.
4532|`old_path` |optional|
4533The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05004534Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01004535|`lines_inserted`|optional|
4536Number of inserted lines. +
4537Not set for binary files or if no lines were inserted.
4538|`lines_deleted` |optional|
4539Number of deleted lines. +
4540Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02004541|`size_delta` ||
4542Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01004543|`size` ||
4544File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01004545|=============================
4546
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004547[[fix-input]]
4548=== FixInput
4549The `FixInput` entity contains options for fixing commits using the
4550link:#fix-change[fix change] endpoint.
4551
4552[options="header",cols="1,6"]
4553|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07004554|Field Name |Description
4555|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004556database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07004557|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07004558merged into the destination branch as this exact SHA-1. If not, insert
4559a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004560|==========================
4561
Edwin Kempine3446292013-02-19 16:40:14 +01004562[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004563=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004564The `GitPersonInfo` entity contains information about the
4565author/committer of a commit.
4566
David Pursehouseae367192014-11-25 17:24:47 +09004567[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01004568|==========================
4569|Field Name |Description
4570|`name` |The name of the author/committer.
4571|`email` |The email address of the author/committer.
4572|`date` |The link:rest-api.html#timestamp[timestamp] of when
4573this identity was constructed.
4574|`tz` |The timezone offset from UTC of when this identity was
4575constructed.
4576|==========================
4577
Edwin Kempin521c1242015-01-23 12:44:44 +01004578[[group-base-info]]
4579=== GroupBaseInfo
4580The `GroupBaseInfo` entity contains base information about the group.
4581
4582[options="header",cols="1,6"]
4583|==========================
4584|Field Name |Description
4585|`id` |The id of the group.
4586|`name` |The name of the group.
4587|==========================
4588
4589[[included-in-info]]
4590=== IncludedInInfo
4591The `IncludedInInfo` entity contains information about the branches a
4592change was merged into and tags it was tagged with.
4593
Edwin Kempin78279ba2015-05-22 15:22:41 +02004594[options="header",cols="1,^1,5"]
4595|=======================
4596|Field Name||Description
4597|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01004598Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02004599|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01004600Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02004601|`external`|optional|A map that maps a name to a list of external
4602systems that include this change, e.g. a list of servers on which this
4603change is deployed.
4604|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01004605
Edwin Kempine3446292013-02-19 16:40:14 +01004606[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004607=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07004608The `LabelInfo` entity contains information about a label on a change, always
4609corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01004610
Dave Borowitz88159512013-06-14 14:21:50 -07004611There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07004612link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07004613
4614* For a quick summary of the state of labels, use `LABELS`.
4615* For detailed information about labels, including exact numeric votes for all
4616 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
4617
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004618==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09004619[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004620|===========================
4621|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004622|`optional` |not set if `false`|
4623Whether the label is optional. Optional means the label may be set, but
4624it's neither necessary for submission nor does it block submission if
4625set.
Dave Borowitz88159512013-06-14 14:21:50 -07004626|===========================
4627
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004628==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09004629[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07004630|===========================
4631|Field Name ||Description
4632|`approved` |optional|One user who approved this label on the change
4633(voted the maximum value) as an
4634link:rest-api-accounts.html#account-info[AccountInfo] entity.
4635|`rejected` |optional|One user who rejected this label on the change
4636(voted the minimum value) as an
4637link:rest-api-accounts.html#account-info[AccountInfo] entity.
4638|`recommended` |optional|One user who recommended this label on the
4639change (voted positively, but not the maximum value) as an
4640link:rest-api-accounts.html#account-info[AccountInfo] entity.
4641|`disliked` |optional|One user who disliked this label on the change
4642(voted negatively, but not the minimum value) as an
4643link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01004644|`blocking` |optional|If `true`, the label blocks submit operation.
4645If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07004646|`value` |optional|The voting value of the user who
4647recommended/disliked this label on the change if it is not
4648"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07004649|`default_value`|optional|The default voting value for the label.
4650This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07004651|===========================
4652
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004653==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09004654[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07004655|===========================
4656|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004657|`all` |optional|List of all approvals for this label as a list
Dave Borowitz88159512013-06-14 14:21:50 -07004658of link:#approval-info[ApprovalInfo] entities.
Edwin Kempine3446292013-02-19 16:40:14 +01004659|`values` |optional|A map of all values that are allowed for this
4660label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07004661to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01004662|===========================
4663
Saša Živkov499873f2014-05-05 13:34:18 +02004664[[mergeable-info]]
4665=== MergeableInfo
4666The `MergeableInfo` entity contains information about the mergeability of a
4667change.
4668
David Pursehouseae367192014-11-25 17:24:47 +09004669[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02004670|============================
Saša Živkov697cab22014-04-29 16:46:50 +02004671|Field Name ||Description
4672|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02004673Submit type used for this change, can be `MERGE_IF_NECESSARY`,
4674`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
4675`CHERRY_PICK`.
Saša Živkov697cab22014-04-29 16:46:50 +02004676|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02004677`true` if this change is cleanly mergeable, `false` otherwise
Saša Živkov697cab22014-04-29 16:46:50 +02004678|`mergeable_into`|optional|
4679A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02004680|============================
Dave Borowitz88159512013-06-14 14:21:50 -07004681
Raviteja Sunkara791f3392015-11-03 13:24:50 +05304682[[move-input]]
4683=== MoveInput
4684The `MoveInput` entity contains information for moving a change to a new branch.
4685
4686[options="header",cols="1,^1,5"]
4687|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04004688|Field Name ||Description
4689|`destination_branch`||Destination branch
4690|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05304691A message to be posted in this change's comments
4692|===========================
4693
Edwin Kempin521c1242015-01-23 12:44:44 +01004694[[problem-info]]
4695=== ProblemInfo
4696The `ProblemInfo` entity contains a description of a potential consistency problem
4697with a change. These are not related to the code review process, but rather
4698indicate some inconsistency in Gerrit's database or repository metadata related
4699to the enclosing change.
4700
4701[options="header",cols="1,^1,5"]
4702|===========================
4703|Field Name||Description
4704|`message` ||Plaintext message describing the problem with the change.
4705|`status` |optional|
4706The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
4707fix was attempted.
4708|`outcome` |optional|
4709If `status` is set, an additional plaintext message describing the
4710outcome of the fix.
4711|===========================
4712
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04004713[[push-certificate-info]]
4714=== PushCertificateInfo
4715The `PushCertificateInfo` entity contains information about a push
4716certificate provided when the user pushed for review with `git push
4717--signed HEAD:refs/for/<branch>`. Only used when signed push is
4718link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
4719
4720[options="header",cols="1,6"]
4721|===========================
4722|Field Name|Description
4723|`certificate`|Signed certificate payload and GPG signature block.
4724|`key` |
4725Information about the key that signed the push, along with any problems
4726found while checking the signature or the key itself, as a
4727link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
4728|===========================
4729
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004730[[range-info]]
4731=== RangeInfo
4732The `RangeInfo` entity stores the coordinates of a range.
4733
4734[options="header",cols="1,6"]
4735|===========================
4736|Field Name | Description
4737|`start` | First index.
4738|`end` | Last index.
4739|===========================
4740
Zalan Blenessy874aed72015-01-12 13:26:18 +01004741[[rebase-input]]
4742=== RebaseInput
4743The `RebaseInput` entity contains information for changing parent when rebasing.
4744
4745[options="header",width="50%",cols="1,^1,5"]
4746|===========================
4747|Field Name ||Description
4748|`base` |optional|
4749The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
4750Alternatively, a change number can be specified, in which case the current
4751patch set is inferred. +
4752Empty string is used for rebasing directly on top of the target branch,
4753which effectively breaks dependency towards a parent change.
4754|===========================
4755
Edwin Kempin521c1242015-01-23 12:44:44 +01004756[[related-change-and-commit-info]]
4757=== RelatedChangeAndCommitInfo
4758
4759The `RelatedChangeAndCommitInfo` entity contains information about
4760a related change and commit.
4761
4762[options="header",cols="1,^1,5"]
4763|===========================
4764|Field Name ||Description
4765|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01004766|`commit` ||The commit as a
4767link:#commit-info[CommitInfo] entity.
4768|`_change_number` |optional|The change number.
4769|`_revision_number` |optional|The revision number.
4770|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004771|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07004772the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01004773|===========================
4774
4775[[related-changes-info]]
4776=== RelatedChangesInfo
4777The `RelatedChangesInfo` entity contains information about related
4778changes.
4779
4780[options="header",cols="1,6"]
4781|===========================
4782|Field Name |Description
4783|`changes` |A list of
4784link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
4785describing the related changes. Sorted by git commit order, newest to
4786oldest. Empty if there are no related changes.
4787|===========================
4788
Edwin Kempined5364b2013-02-22 10:39:33 +01004789[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004790=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01004791The `RestoreInput` entity contains information for restoring a change.
4792
David Pursehouseae367192014-11-25 17:24:47 +09004793[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01004794|===========================
4795|Field Name ||Description
4796|`message` |optional|
4797Message to be added as review comment to the change when restoring the
4798change.
4799|===========================
4800
Edwin Kempind2ec4152013-02-22 12:17:19 +01004801[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004802=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01004803The `RevertInput` entity contains information for reverting a change.
4804
David Pursehouseae367192014-11-25 17:24:47 +09004805[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01004806|===========================
4807|Field Name ||Description
4808|`message` |optional|
4809Message to be added as review comment to the change when reverting the
4810change.
4811|===========================
4812
Edwin Kempin67498de2013-02-25 16:15:34 +01004813[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004814=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01004815The `ReviewInfo` entity contains information about a review.
4816
David Pursehouseae367192014-11-25 17:24:47 +09004817[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01004818|===========================
4819|Field Name |Description
4820|`labels` |
4821The labels of the review as a map that maps the label names to the
4822voting values.
4823|===========================
4824
4825[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004826=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01004827The `ReviewInput` entity contains information for adding a review to a
4828revision.
4829
David Pursehouseae367192014-11-25 17:24:47 +09004830[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01004831|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07004832|Field Name ||Description
4833|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01004834The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004835|`tag` |optional|
4836Apply this tag to the review comment message, votes, and inline
4837comments. Tags may be used by CI or other automated systems to
4838distinguish them from human reviews. Comments with specific tag
4839values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004840|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01004841The votes that should be added to the revision as a map that maps the
4842label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004843|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01004844The comments that should be added as a map that maps a file path to a
4845list of link:#comment-input[CommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004846|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05004847Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01004848based on access controls. +
4849If `true`, attempting to use a label not granted to the user will fail
4850the entire modify operation early. +
4851If `false`, the operation will execute anyway, but the proposed labels
4852will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004853|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01004854Draft handling that defines how draft comments are handled that are
4855already in the database but that were not also described in this
4856input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02004857Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
4858`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
4859for a single revision. +
Edwin Kempin67498de2013-02-25 16:15:34 +01004860If not set, the default is `DELETE`.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004861|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01004862Notify handling that defines to whom email notifications should be sent
4863after the review is stored. +
4864Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
4865If not set, the default is `ALL`.
Bill Wendling692b4ec2015-10-19 15:40:57 -07004866|`omit_duplicate_comments`|optional|
4867If `true`, comments with the same content at the same place will be omitted.
4868|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07004869link:rest-api-accounts.html#account-id[\{account-id\}] the review
4870should be posted on behalf of. To use this option the caller must
4871have been granted `labelAs-NAME` permission for all keys of labels.
Edwin Kempin67498de2013-02-25 16:15:34 +01004872|============================
4873
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004874[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004875=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004876The `ReviewerInfo` entity contains information about a reviewer and its
4877votes on a change.
4878
Edwin Kempin963dfd02013-02-27 12:39:32 +01004879`ReviewerInfo` has the same fields as
4880link:rest-api-accounts.html#account-info[AccountInfo] and includes
4881link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004882In addition `ReviewerInfo` has the following fields:
4883
David Pursehouseae367192014-11-25 17:24:47 +09004884[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004885|==========================
4886|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004887|`approvals` |
4888The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09004889approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01004890|==========================
4891
Edwin Kempin392328e2013-02-25 12:50:03 +01004892[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004893=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01004894The `ReviewerInput` entity contains information for adding a reviewer
4895to a change.
4896
David Pursehouseae367192014-11-25 17:24:47 +09004897[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01004898|===========================
4899|Field Name ||Description
4900|`reviewer` ||
4901The link:rest-api-accounts.html#account-id[ID] of one account that
4902should be added as reviewer or the link:rest-api-groups.html#group-id[
4903ID] of one group for which all members should be added as reviewers. +
4904If an ID identifies both an account and a group, only the account is
4905added as reviewer to the change.
4906|`confirmed` |optional|
4907Whether adding the reviewer is confirmed. +
4908The Gerrit server may be configured to
4909link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
4910confirmation] when adding a group as reviewer that has many members.
4911|===========================
4912
Edwin Kempine3446292013-02-19 16:40:14 +01004913[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004914=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004915The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07004916Not all fields are returned by default. Additional fields can
4917be obtained by adding `o` parameters as described in
4918link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01004919
David Pursehouseae367192014-11-25 17:24:47 +09004920[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004921|===========================
4922|Field Name ||Description
4923|`draft` |not set if `false`|Whether the patch set is a draft.
4924|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01004925|`created` ||
4926The link:rest-api.html#timestamp[timestamp] of when the patch set was
4927created.
4928|`uploader` ||
4929The uploader of the patch set as an
4930link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01004931|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01004932|`fetch` ||
4933Information about how to fetch this patch set. The fetch information is
4934provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07004935"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
4936only included if a plugin implementing the
4937link:intro-project-owner.html#download-commands[download commands]
4938interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07004939|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01004940link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07004941|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01004942The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07004943link:#file-info[FileInfo] entities. Only set if
4944link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
4945option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07004946|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004947Actions the caller might be able to perform on this revision. The
4948information is a map of view name to link:#action-info[ActionInfo]
4949entities.
Khai Dob3139b7532014-09-19 15:13:04 -07004950|`reviewed` |optional|
4951Indicates whether the caller is authenticated and has commented on the
4952current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07004953|`messageWithFooter` |optional|
4954If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
4955this is the current patch set, contains the full commit message with
4956Gerrit-specific commit footers, as if this revision were submitted
4957using the link:project-configuration.html#cherry_pick[Cherry Pick]
4958submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04004959|`push_certificate` |optional|
4960If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
4961contains the push certificate provided by the user when uploading this
4962patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
4963This field is always set if the option is requested; if no push
4964certificate was provided, it is set to an empty object.
Edwin Kempine3446292013-02-19 16:40:14 +01004965|===========================
4966
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004967[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004968=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004969The `RuleInput` entity contains information to test a Prolog rule.
4970
David Pursehouseae367192014-11-25 17:24:47 +09004971[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004972|===========================
4973|Field Name ||Description
4974|`rule`||
4975Prolog code to execute instead of the code in `refs/meta/config`.
4976|`filters`|`RUN` if not set|
4977When `RUN` filter rules in the parent projects are called to
4978post-process the results of the project specific rule. This
4979behavior matches how the rule will execute if installed. +
4980If `SKIP` the parent filters are not called, allowing the test
4981to return results from the input rule.
4982|===========================
4983
Edwin Kempin14b58112013-02-26 16:30:19 +01004984[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004985=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01004986The `SubmitInfo` entity contains information about the change status
4987after submitting.
4988
Stefan Bellere4785b42015-06-18 12:31:03 -07004989[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01004990|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07004991|Field Name ||Description
4992|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07004993The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01004994|`on_behalf_of`|optional|
4995The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
4996whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09004997have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
4998The user named by `on_behalf_of` does not need to be granted the `Submit`
4999permission. This feature is aimed for CI solutions: the CI account can be
5000granted both permssions, so individual users don't need `Submit` permission
5001themselves. Still the changes can be submited on behalf of real users and
5002not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01005003|==========================
5004
Edwin Kempin0eddba02013-02-22 15:30:12 +01005005[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005006=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01005007The `SubmitInput` entity contains information for submitting a change.
5008
David Pursehouseae367192014-11-25 17:24:47 +09005009[options="header",cols="1,^1,5"]
Edwin Kempin0eddba02013-02-22 15:30:12 +01005010|===========================
5011|Field Name ||Description
Dave Borowitzc6d143d2016-02-24 12:32:23 -05005012|`on_behalf_of`|optional|
5013If set, submit the change on behalf of the given user. The value may take any
5014format link:rest-api-accounts.html#account-id[accepted by the accounts REST
5015API]. Using this option requires
5016link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
5017permission on the branch.
Stephen Lia5a5ef02016-03-31 16:55:53 -07005018|`notify`|optional|
5019Notify handling that defines to whom email notifications should be sent after
5020the change is submitted. +
5021Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5022If not set, the default is `ALL`.
Edwin Kempin0eddba02013-02-22 15:30:12 +01005023|===========================
5024
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005025[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005026=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005027The `SubmitRecord` entity describes results from a submit_rule.
5028
David Pursehouseae367192014-11-25 17:24:47 +09005029[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005030|===========================
5031|Field Name ||Description
5032|`status`||
5033`OK`, the change can be submitted. +
5034`NOT_READY`, additional labels are required before submit. +
5035`CLOSED`, closed changes cannot be submitted. +
5036`RULE_ERROR`, rule code failed with an error.
5037|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01005038Map of labels that are approved; an
5039link:rest-api-accounts.html#account-info[AccountInfo] identifies the
5040voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005041|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01005042Map of labels that are preventing submit;
5043link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005044|`need`|optional|
5045Map of labels that need to be given to submit. The value is
5046currently an empty object.
5047|`may`|optional|
5048Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01005049link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
5050if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005051|`impossible`|optional|
5052Map of labels that should have been in `need` but cannot be
5053used by any user because of access restrictions. The value
5054is currently an empty object.
5055|`error_message`|optional|
5056When status is RULE_ERROR this message provides some text describing
5057the failure of the rule predicate.
5058|===========================
5059
Edwin Kempin521c1242015-01-23 12:44:44 +01005060[[suggested-reviewer-info]]
5061=== SuggestedReviewerInfo
5062The `SuggestedReviewerInfo` entity contains information about a reviewer
5063that can be added to a change (an account or a group).
5064
5065`SuggestedReviewerInfo` has either the `account` field that contains
5066the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
5067the `group` field that contains the
5068link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
5069
Edwin Kempin64006bb2013-02-22 08:17:04 +01005070[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005071=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01005072The `TopicInput` entity contains information for setting a topic.
5073
David Pursehouseae367192014-11-25 17:24:47 +09005074[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01005075|===========================
5076|Field Name ||Description
5077|`topic` |optional|The topic. +
5078The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01005079|===========================
5080
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005081[[web-link-info]]
5082=== WebLinkInfo
5083The `WebLinkInfo` entity describes a link to an external site.
5084
David Pursehouseae367192014-11-25 17:24:47 +09005085[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005086|======================
5087|Field Name|Description
5088|`name` |The link name.
5089|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02005090|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005091|======================
5092
Edwin Kempind0a63922013-01-23 16:32:59 +01005093GERRIT
5094------
5095Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005096
5097SEARCHBOX
5098---------