Diff Commit List Resource¶
Added in 4.0
Provides information on a collection of commits in a review request.
Each diff commit resource contains individual per-file diffs as child resources, as well as metadata to reproduce the actual commits in a version control system.
Details¶
Name | commits |
URI | /api/review-requests/{review_request_id}/diffs/{diff_revision}/commits/ |
Required Features |
|
Token Policy ID | commit |
HTTP Methods |
|
Parent Resource | Diff Resource |
Child Resources |
Links¶
Name | Method | Resource |
---|---|---|
self | GET | Diff Commit List Resource |
HTTP GET¶
Return the list of commits.
Request Parameters¶
counts-onlyBoolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
max-resultsInteger | The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link. |
startInteger | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
Examples¶
application/vnd.reviewboard.org.commits+json¶
$ curl https://reviews.example.com/api/review-requests/10/diffs/1/commits/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 1082
Content-Type: application/vnd.reviewboard.org.commits+json
ETag: 36972b2cb0dc811b6b43a02565fda0bb3a496272
Item-Content-Type: application/vnd.reviewboard.org.commit+json
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"commits": [
{
"author_date": "2011-03-05T19:40:11-06:00",
"author_email": "christian@beanbaginc.com",
"author_name": "Christian Hammond",
"commit_id": "e76c016e09c415d7afc4c004a8a290b3c51bff59",
"commit_message": "added tests\n",
"committer_date": "2011-03-05T19:40:11-06:00",
"committer_email": "christian@beanbaginc.com",
"committer_name": "Christian Hammond",
"extra_data": {},
"filename": "diff",
"id": 1,
"links": {
"files": {
"href": "https://reviews.example.com/api/review-requests/10/diffs/1/files/?commit-id=e76c016e09c415d7afc4c004a8a290b3c51bff59",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/review-requests/10/diffs/1/commits/e76c016e09c415d7afc4c004a8a290b3c51bff59/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/review-requests/10/diffs/1/commits/e76c016e09c415d7afc4c004a8a290b3c51bff59/",
"method": "PUT"
}
},
"parent_id": "1baa5285167980271becd922acd77a20a20b916b"
}
],
"links": {
"self": {
"href": "https://reviews.example.com/api/review-requests/10/diffs/1/commits/",
"method": "GET"
}
},
"stat": "ok",
"total_results": 1
}