Closed owenthereal closed 10 years ago
It still doesn't support getting a raw patch for a commit?
@mislav For raw patch, I'm thinking to achieve like this:
url, _ := octokit.CommitURL.Expand(xxx)
req := client.NewRequest(url)
req.Header.Add("Accept", "application/vnd.github.v3.patch")
resp, _ := req.Get()
ioutil.ReadAll(resp.Body) // patch
I'm still thinking whether we should expose it as an API to CommitsService
. Similar situation for gist and pull request.
I'm still thinking whether we should expose it as an API to CommitsService. Similar situation for gist and pull request.
Making a dedicated API for this use case would be great for users because they shouldn't be concerned with implementation details of GitHub API such as custom MIME types in request.
However, if you're fine with a lower-level API like you've just demonstrated, it will work for our purposes as well.
Making a dedicated API for this use case would be great for users because they shouldn't be concerned with implementation details of GitHub API such as custom MIME types in request.
I think I'm convinced this would be best solution for now, although it seems the patching API is only useful for very particular use case.
On Tue, Jul 29, 2014 at 4:45 PM, Jingwen Owen Ou notifications@github.com wrote:
I think I'm convinced this would be best solution for now, although it seems the patching API is only useful for very particular use case.
DO ITTT :+1:
@mislav How does https://github.com/octokit/go-octokit/commit/88741d50a1219f8a321581ba82f63365285fd948 taste? CommitsService#Patch
returns a IO for reading the patch.
Looks pretty good. Perfect abstraction level for this kind of stuff.
This is to support https://github.com/github/hub/pull/601
/cc @mislav