summaryrefslogtreecommitdiff
path: root/doc/api/commits.md
diff options
context:
space:
mode:
authorJeroen Jacobs <git@jeroenj.be>2014-06-27 16:48:30 +0200
committerJeroen Jacobs <git@jeroenj.be>2014-09-26 10:58:11 +0200
commit430758653ce7e4d32b40648e6263b79c2709bdad (patch)
treedc62ecc9587f532406495ac4a6ac5e53e490088f /doc/api/commits.md
parentde5e0e590fa4e75cb9d66398b902a8348a2c42dc (diff)
downloadgitlab-ce-430758653ce7e4d32b40648e6263b79c2709bdad.tar.gz
Adds comments to commits in the API
Diffstat (limited to 'doc/api/commits.md')
-rw-r--r--doc/api/commits.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/doc/api/commits.md b/doc/api/commits.md
index 9475ecbaa67..eb8d6a43592 100644
--- a/doc/api/commits.md
+++ b/doc/api/commits.md
@@ -93,3 +93,66 @@ Parameters:
}
]
```
+
+## Get the comments of a commit
+
+Get the comments of a commit in a project.
+
+```
+GET /projects/:id/repository/commits/:sha/comments
+```
+
+Parameters:
+
+- `id` (required) - The ID of a project
+- `sha` (required) - The name of a repository branch or tag or if not given the default branch
+
+```json
+[
+ {
+ "note": "this code is really nice",
+ "author": {
+ "id": 11,
+ "username": "admin",
+ "email": "admin@local.host",
+ "name": "Administrator",
+ "state": "active",
+ "created_at": "2014-03-06T08:17:35.000Z"
+ }
+ }
+]
+```
+
+## Post comment to commit
+
+Adds a comment to a commit. Optionally you can post comments on a specific line of a commit. Therefor both `path`, `line_new` and `line_old` are required.
+
+```
+POST /projects/:id/repository/commits/:sha/comments
+```
+
+Parameters:
+
+- `id` (required) - The ID of a project
+- `sha` (required) - The name of a repository branch or tag or if not given the default branch
+- `note` (required) - Text of comment
+- `path` (optional) - The file path
+- `line` (optional) - The line number
+- `line_type` (optional) - The line type (new or old)
+
+```json
+{
+ "author": {
+ "id": 1,
+ "username": "admin",
+ "email": "admin@local.host",
+ "name": "Administrator",
+ "blocked": false,
+ "created_at": "2012-04-29T08:46:00Z"
+ },
+ "note": "text1",
+ "path": "example.rb",
+ "line": 5,
+ "line_type": "new"
+}
+```