Skip to content

Commit d0a7479

Browse files
committed
Clarify pagination
1 parent 82e1b57 commit d0a7479

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

content/v3.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,12 @@ resources, you can also set a custom page size up to 100 with the `?per_page` pa
176176
$ curl https://api.github.com/user/repos?page=2&per_page=100
177177
</pre>
178178

179-
The pagination info is included in [the Link header](http://www.w3.org/Protocols/9707-link-header.html):
179+
The pagination info is included in [the Link
180+
header](http://www.w3.org/Protocols/9707-link-header.html). It is important to
181+
follow these Link header values instead of constructing your own URLs. In some
182+
instances, such as in the [Commits
183+
API](/v3/repos/commits/), pagination is based on
184+
SHA1 and not on page number.
180185

181186
Link: <https://api.github.com/user/repos?page=3&per_page=100>; rel="next",
182187
<https://api.github.com/user/repos?page=50&per_page=100>; rel="last"

content/v3/repos/commits.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ title: Repo Commits | GitHub API
44

55
# Repo Commits API
66

7+
The Repo Commits API supports listing, viewing, and comparing commits in a repository.
8+
79
## List commits on a repository
810

911
GET /repos/:user/:repo/commits
1012

13+
_A special note on pagination:_ Due to the way Git works, commits are paginated
14+
based on SHA instead of page number. Please follow the link headers as outlined
15+
in the [pagination overview](http://developer.github.com/v3/#pagination)
16+
instead of constructing page links yourself.
17+
1118
### Parameters
1219

1320
sha

0 commit comments

Comments
 (0)