forked from github/developer.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchanges.atom
More file actions
172 lines (142 loc) · 8.78 KB
/
changes.atom
File metadata and controls
172 lines (142 loc) · 8.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>http://developer.github.com/</id>
<title>GitHub API Changes</title>
<updated>2012-09-28T07:00:00Z</updated>
<link rel="alternate" href="http://developer.github.com/" />
<link rel="self" href="http://developer.github.com/changes.atom" />
<author>
<name>technoweenie</name>
<uri>https://github.com/technoweenie</uri>
</author>
<entry>
<id>tag:developer.github.com,2012-09-28:/changes/2012-9-28-auto-init-for-repositories/</id>
<title type="html">Initialize a repository when creating</title>
<published>2012-09-28T07:00:00Z</published>
<updated>2012-09-28T07:00:00Z</updated>
<author>
<name>pengwynn</name>
<uri>https://github.com/technoweenie</uri>
</author>
<link rel="alternate" href="http://developer.github.com/changes/2012-9-28-auto-init-for-repositories/" />
<content type="html"><p>Today we’ve made it easier to add commits to a repository via the GitHub API.
Until now, you could <a href="/v3/repos/#create">create a repository</a>, but you would
need to initialize it locally via your Git client before adding any commits via
the API.</p>
<p>Now you can optionally init a repository when it’s created by sending <code>true</code>
for the <code>auto_init</code> parameter:</p>
<pre class="terminal">
curl -i -u pengwynn \
-d '{"name": "create-repo-test", "auto_init": true}' \
https://api.github.com/user/repos
</pre>
<p>The resulting repository will have a README stub and an initial commit.</p>
<p><img src="/images/posts/create-repo-init.png" alt="create repo screenshot"></p>
<h3 id="gitignore-templates">.gitignore templates</h3>
<p>Along with this change, you can set up your <code>.gitignore</code> template by passing
the basename of any template in the <a href="https://github.com/github/gitignore">GitHub gitignore templates
project</a>.</p>
<pre class="terminal">
curl -i -u pengwynn \
-d '{"name": "create-repo-test", "auto_init": true, \
"gitignore_template": "Haskell"}' \
https://api.github.com/user/repos
</pre>
<p>As the <a href="/v3/repos/#create">docs point out</a>, the <code>gitignore_template</code> parameter
is ignored if <code>auto_init</code> is not present and <code>true</code>.</p>
<p>If you have any questions or feedback, drop us a line at
<a href="https://github.com/c">https://github.com/contact</a>, <a href="mailto:[email protected]">[email protected]</a>, or
<a href="https://twitter.com/githubapi">@GitHubAPI</a>.</p></content>
</entry>
<entry>
<id>tag:developer.github.com,2012-09-05:/changes/2012-9-5-watcher-api/</id>
<title type="html">Upcoming Changes to Watcher and Star APIs</title>
<published>2012-09-05T07:00:00Z</published>
<updated>2012-09-05T07:00:00Z</updated>
<author>
<name>technoweenie</name>
<uri>https://github.com/technoweenie</uri>
</author>
<link rel="alternate" href="http://developer.github.com/changes/2012-9-5-watcher-api/" />
<content type="html"><p>We recently <a href="https://github.com/blog/1204-notifications-stars">changed the Watcher behavior</a> on GitHub. What
used to be known as “Watching” is now “Starring”. Starring is basically a way
to bookmark interesting repositories. Watching is a way to indicate that you
want to receive email or web notifications on a Repository.</p>
<p>This works well on GitHub.com, but poses a problem for the GitHub API. How do
we change this in a way that developers can gracefully upgrade their
applications? We’re currently looking at rolling out the changes in three
phases over an extended period of time.</p>
<h2 id="current-status">Current Status</h2>
<p>The current <a href="http://developer.github.com/v3/repos/starring/">Repository Starring</a> methods look like this:</p>
<ul>
<li>
<code>/repos/:owner/:repo/watchers</code> - A list of users starring the repository.</li>
<li>
<code>/users/:user/watched</code> - A list of repositories that a user has starred.</li>
<li>
<code>/user/watched</code> - A list of repositories the current user has starred.</li>
</ul><h2 id="phase-1-add-watchers-as-subscriptions">Phase 1: Add Watchers as Subscriptions</h2>
<p>This phase exposes Watchers as “Subscriptions”. This is to
keep from clashing with the legacy endpoints. This phase will happen
automatically and will not break your application until Phase 3 starts.</p>
<ul>
<li>
<code>/repos/:owner/:repo/subscribers</code> - A list of users watching the repository.</li>
<li>
<code>/users/:user/subscriptions</code> - A list of repositories that a user is watching.</li>
<li>
<code>/user/subscriptions</code> - A list of repositories the current user is watching.</li>
</ul><p>We’ll also add a copy of the legacy Watchers API in the new endpoint:</p>
<ul>
<li>
<code>/repos/:owner/:repo/stargazers</code> - A list of users starring the repository.</li>
<li>
<code>/users/:user/starred</code> - A list of repositories that a user has starred.</li>
<li>
<code>/user/starred</code> - A list of repositories the current user has starred.</li>
</ul><p>This is in place <em>now</em> with the current media type for the API:</p>
<pre><code>application/vnd.github.beta+json
</code></pre>
<p>If you care about your application not breaking, make sure all outgoing API
requests pass that value for the “Accept” header. You should do this now. This
can be verified by checking the <code>X-GitHub-Media-Type</code> header on all API
responses.</p>
<pre><code># Accesses a user's starred repositories.
curl https://api.github.com/user/watched \
-H "Accept: application/vnd.github.beta+json"
</code></pre>
<p>This Phase will be broken once Phase 3 starts. Phase 3 removes all support for
the “beta” media type, and makes the “v3” media type the implicit default
for API requests.</p>
<h2 id="phase-2-switch-watchers-api-endpoint">Phase 2: Switch <code>/watchers</code> API Endpoint</h2>
<p>The “watch” endpoints will now be a copy of the “subscription” endpoints. You
will have to use <code>/user/starred</code> to get a user’s starred repositories, not
<code>/user/watched</code>.</p>
<p>This requires a new media type value:</p>
<pre><code>application/vnd.github.v3+json
</code></pre>
<p>This is a breaking change from Phase 1. We will release this change in an
experimental mode first, letting developers gracefully upgrade their
applications by specifying the new media value for the Accept header.</p>
<pre><code># Accesses a user's watched repositories.
curl https://api.github.com/user/watched \
-H "Accept: application/vnd.github.v3+json"
</code></pre>
<h2 id="phase-3-remove-subscribers-api-endpoint">Phase 3: Remove <code>/subscribers</code> API Endpoint.</h2>
<p>This phase involves disabling the subscription endpoints completely. At this
point, you should be using the starring endpoints for starred repositories, and
the watch endpoints for watched repositories. No date has been set yet, but we
expect this to be <em>3-6 months</em> after Phase 2 is in place. This should give
developers enough time for a smooth upgrade path. If they use popular API
wrappers, the work will likely mostly be done for them.</p>
<p>Keep on passing the “v3” media type in your application, until the API has
another breaking change to make. If you can’t make the deadline for Phase 3,
just set the “beta” media type until we shut that down completely. It’s likely
that we will keep the old “beta” media type active for another month, like
the <a href="https://github.com/blog/1090-github-api-moving-on">last time</a> we terminated
old API functionality.</p>
<p>We look forward to assisting you through this transition. Hit us up at
<a href="https://github.com/c">https://github.com/contact</a>, <a href="mailto:[email protected]">[email protected]</a>, or
<a href="https://twitter.com/githubapi">@GitHubAPI</a>.</p></content>
</entry>
</feed>