Announcement: https://developer.github.com/changes/2017-01-05-commit-search-api/.
Docs: https://developer.github.com/v3/search/#search-commits.
This was announced today.
Since it's going to be similar to #497, I can work on it 馃槂
@shurcooL can you please assign this to me? I have been busy last week. I will start working on this today.
In earlier commit objects, GitHub used to send key sha which had the hash of the commit. However, in this new commits search endpoint, the returned commit object has hash key for the same.
I will get in touch with GitHub support to confirm the difference and to suggest to possibly have the same parameters to have consistency.
@shurcooL can you please assign this to me?
In order to be able to assign you, you'll need to be invited by @gmlewis first.
@shurcooL should we keep all the information available in the commit object or can we skip some fields?
For example - all different URLs here - https://developer.github.com/v3/search/#example-1
@sahildua2305 - I'll send an invite.
Thanks @gmlewis
@shurcooL should we keep all the information available in the commit object or can we skip some fields?
It's okay to skip the _url fields if you think they're unlikely to be useful (and someone else can add them later if they actually need them). It's also okay to include them. See https://github.com/google/go-github/issues/419#issuecomment-241466941 for background on our stance regarding those fields.
That said, is there an existing struct we can use to parse the items in a commit search response, or will it have to be a new struct?
That said, is there an existing struct we can use to parse the items in a commit search response, or will it have to be a new struct?
As far as I have checked, the closest matching struct was commit from git_commits.go. However, the format of output for this search endpoint is completely different from that for the older commit output format. Hence, I will go with a new struct. Please let me know if you find something matching.
Hence, I will go with a new struct.
I've looked a bit, and came to the same conclusion, @sahildua2305. SGTM. 馃憤
Most helpful comment
Since it's going to be similar to #497, I can work on it 馃槂