Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Move Repo Comments API to its own page.#79

Merged
pengwynn merged 1 commit intogithub:masterfrombgrainger:comments
May 25, 2012
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletionscontent/v3/repos/comments.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
---
title: Repo Comments | GitHub API
---

# Repo Comments API

## List commit comments for a repository

Commit Comments leverage [these](#custom-mime-types) custom mime types. You can
read more about the use of mime types in the API [here](/v3/mime/).

Comments are ordered by ascending ID.

GET /repos/:user/:repo/comments

### Response

<%= headers 200 %>
<%= json(:commit_comment) { |h| [h] } %>

## List comments for a single commit

GET /repos/:user/:repo/commits/:sha/comments

### Response

<%= headers 200 %>
<%= json(:commit_comment) %>

## Create a commit comment

POST /repos/:user/:repo/commits/:sha/comments

### Input

body
: _Required_ **string**

commit_id
: _Required_ **string** - Sha of the commit to comment on.

line
: _Required_ **number** - Line number in the file to comment on.

path
: _Required_ **string** - Relative path of the file to comment on.

position
: _Required_ **number** - Line index in the diff to comment on.

#### Example

<%= json \
:body => 'Nice change',
:commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
:line => 1,
:path => 'file1.txt',
:position => 4
%>

### Response

<%= headers 201, :Location => "https://api.github.com/user/repo/comments/1" %>
<%= json :commit_comment %>

## Get a single commit comment

GET /repos/:user/:repo/comments/:id

### Response

<%= headers 200 %>
<%= json :commit_comment %>

## Update a commit comment

PATCH /repos/:user/:repo/comments/:id

### Input

body
: _Required_ **string**

#### Example

<%= json \
:body => 'Nice change'
%>

### Response

<%= headers 200 %>
<%= json :commit_comment %>

## Delete a commit comment

DELETE /repos/:user/:repo/comments/:id

### Response

<%= headers 204 %>

## Custom Mime Types

These are the supported mime types for commit comments. You can read more
about the use of mime types in the API [here](/v3/mime/).

application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json
106 changes: 0 additions & 106 deletionscontent/v3/repos/commits.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,116 +33,10 @@ will be returned.

Note: Diffs with binary data will have no 'patch' property.

## List commit comments for a repository

Commit Comments leverage [these](#custom-mime-types) custom mime types. You can
read more about the use of mime types in the API [here](/v3/mime/).

Comments are ordered by ascending ID.

GET /repos/:user/:repo/comments

### Response

<%= headers 200 %>
<%= json(:commit_comment) { |h| [h] } %>

## List comments for a single commit

GET /repos/:user/:repo/commits/:sha/comments

### Response

<%= headers 200 %>
<%= json(:commit_comment) %>

## Create a commit comment

POST /repos/:user/:repo/commits/:sha/comments

### Input

body
: _Required_ **string**

commit_id
: _Required_ **string** - Sha of the commit to comment on.

line
: _Required_ **number** - Line number in the file to comment on.

path
: _Required_ **string** - Relative path of the file to comment on.

position
: _Required_ **number** - Line index in the diff to comment on.

#### Example

<%= json \
:body => 'Nice change',
:commit_id => '6dcb09b5b57875f334f61aebed695e2e4193db5e',
:line => 1,
:path => 'file1.txt',
:position => 4
%>

### Response

<%= headers 201, :Location => "https://api.github.com/user/repo/comments/1" %>
<%= json :commit_comment %>

## Get a single commit comment

GET /repos/:user/:repo/comments/:id

### Response

<%= headers 200 %>
<%= json :commit_comment %>

## Update a commit comment

PATCH /repos/:user/:repo/comments/:id

### Input

body
: _Required_ **string**

#### Example

<%= json \
:body => 'Nice change'
%>

### Response

<%= headers 200 %>
<%= json :commit_comment %>

## Compare two commits

GET /repos/:user/:repo/compare/:base...:head

### Response

<%= json :commit_comparison %>

## Delete a commit comment

DELETE /repos/:user/:repo/comments/:id

### Response

<%= headers 204 %>

## Custom Mime Types

These are the supported mime types for commit comments. You can read more
about the use of mime types in the API [here](/v3/mime/).

application/vnd.github-commitcomment.raw+json
application/vnd.github-commitcomment.text+json
application/vnd.github-commitcomment.html+json
application/vnd.github-commitcomment.full+json
1 change: 1 addition & 0 deletionslayouts/default.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -89,6 +89,7 @@ <h3><a href="#" class="js-expand-btn collapsed">&nbsp;</a><a href="/v3/pulls/">P
<h3><a href="#" class="js-expand-btn collapsed">&nbsp;</a><a href="/v3/repos/">Repos</a></h3>
<ul class="js-guides">
<li><a href="/v3/repos/collaborators/">Collaborators</a></li>
<li><a href="/v3/repos/comments/">Comments</a></li>
<li><a href="/v3/repos/commits/">Commits</a></li>
<li><a href="/v3/repos/downloads/">Downloads</a></li>
<li><a href="/v3/repos/forks/">Forks</a></li>
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp