开发者

Github API - commits by author

开发者 https://www.devze.com 2022-12-10 05:40 出处:网络
I am wondering if it is at all possible to use GitHub\'s API1 to retrieve a list of commits by a given author (for a specific repository, branch).One can grab recent commits to a repository and branch

I am wondering if it is at all possible to use GitHub's API1 to retrieve a list of commits by a given author (for a specific repository, branch). One can grab recent commits to a repository and branch (e.g. mojombo's grit repository's master branch in JSON format: http://github.com/api/v2/json/commits/list/mojombo/grit/master) but I would like to know if it is possible to filter this by author (hopefully it is just something I've missed in the documentation or is available but not documented).

So, does anyone know if something exists like http://github.com/api/v2/:format/commits/list/mojombo/grit/master/:authorname (this obviously does not work). I am also open to suggestions about generating such a list myself (via the git开发者_如何学Python command). Any ideas?

[1] http://develop.github.com/


Update August 2012

Filtering the commits by author has been added to the v3 API. The author parameter is available for the List commits on a repository action (GET /repos/:user/:repo/commits).

After almost three years, thank you Wynn from Github!


Using the API I don't think there's another way besides getting the commit list and searching for a user.

But with a cloned repository git log has a parameter that does this:

--author=<pattern>, --committer=<pattern>  Limit the commits output to ones 
with author/committer header lines that match the specified pattern (regular expression).
0

精彩评论

暂无评论...
验证码 换一张
取 消