Skip to content

Commit 030aa91

Browse files
committed
fixups and commit listing api
1 parent a35e116 commit 030aa91

5 files changed

Lines changed: 86 additions & 2 deletions

File tree

content/v3/git/commits.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,42 @@ title: Git DB Commits API v3 | developer.github.com
66

77
## List commits
88

9-
GET /repos/:user/:repo/git/commits?start=:ref&max=:max
9+
GET /repos/:user/:repo/git/commits
10+
11+
### Parameters
12+
13+
start
14+
: _String_ of the reference or SHA to start at, or an _Array_ of them if
15+
you want multiple starting points. Defaults to the default branch on the
16+
server.
17+
18+
not
19+
: _String_ of the reference or SHA to end at, or an _Array_ of them if
20+
you want multiple ending points
21+
22+
after
23+
: _Timestamp_ to return commits only authored after the specified date
24+
25+
before
26+
: _Timestamp_ to return commits only authored before the specified date
27+
28+
grep
29+
: _String_ of regex to match against the commit messages
30+
31+
author
32+
: _String_ of regex to match against the author names and email addresses
33+
34+
max
35+
: _Integer_ of maximum number of results to return
36+
37+
path
38+
: _String_ of path limiter - only return commits that modified the given
39+
path
40+
41+
### Response
42+
43+
<%= headers 200, :pagination => true %>
44+
<%= json :commits %>
1045

1146
## Get a Commit
1247

content/v3/git/import.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Git DB Import API v3 | developer.github.com
3+
---
4+
5+
# Import API
6+
7+
`git fast-import` input parser
8+

content/v3/git/refs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ out or setting it to `false` will make sure you're not overwriting work.
6464
<%= json :ref => "refs/heads/master", "type" => "commit", \
6565
"sha"=>"827efc6d56897b048c772eb4087f854f46256132" %>
6666

67+
## Get the Reference History
68+
69+
GET /repos/:user/:repo/git/reflogs
70+
71+

layouts/default.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ <h3><a href="/v3/users/">Users</a></h3>
6464
</ul>
6565
</li>
6666
<li>
67-
<h3><a href="/v3/git/">Git DB</a></h3>
67+
<h3><a href="/v3/git/">Git Data</a></h3>
6868
<ul>
6969
<li><a href="/v3/git/blobs/">Blobs</a></li>
7070
<li><a href="/v3/git/trees/">Trees</a></li>
7171
<li><a href="/v3/git/commits/">Commits</a></li>
7272
<li><a href="/v3/git/tags/">Tags</a></li>
7373
<li><a href="/v3/git/refs/">References</a></li>
74+
<li><a href="/v3/git/import/">Import</a></li>
7475
</ul>
7576
</li>
7677
</ul>

lib/resources.rb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,41 @@ def json(key)
335335
"parents" => ["7d1b31e74ee336d15cbd21741bc88a537ed063a0"]
336336
}
337337

338+
COMMITS_REST = [
339+
{ "sha" => "7d1b31e74ee336d15cbd21741bc88a537ed063a0",
340+
"author" => {
341+
"name" => "Scott Chacon",
342+
"email" => "scott@github.com",
343+
"date" => "2008-07-08T16:13:30+12:00"
344+
},
345+
"committer" => {
346+
"name" => "Scott Chacon",
347+
"email" => "scott@github.com",
348+
"date" => "2008-07-08T16:13:30+12:00"
349+
},
350+
"message" => "my older commit message",
351+
"tree" => "392662aae29f314a428bfc6b619d97bd4ad4a727",
352+
"parents" => ["afc99de753646e2c438203430e97671971740d35"]
353+
},
354+
{ "sha" => "afc99de753646e2c438203430e97671971740d35",
355+
"author" => {
356+
"name" => "Scott Chacon",
357+
"email" => "scott@github.com",
358+
"date" => "2008-07-07T16:13:30+12:00"
359+
},
360+
"committer" => {
361+
"name" => "Scott Chacon",
362+
"email" => "scott@github.com",
363+
"date" => "2008-07-07T16:13:30+12:00"
364+
},
365+
"message" => "my first commit message",
366+
"tree" => "8bcac778496eb77c1928aa9778f5112c6a822a19",
367+
"parents" => []
368+
}
369+
]
370+
371+
COMMITS = [COMMIT] + COMMITS_REST
372+
338373
TAG = {
339374
"sha" => "b8d04eddde9f53f3bc76dd048f3477062a27c91a",
340375
"tag" => "v1.0",

0 commit comments

Comments
 (0)