【问题标题】:Github API - commits by authorGithub API - 作者提交
【发布时间】:2010-12-13 20:47:08
【问题描述】:

我想知道是否可以使用 GitHub 的 API1 来检索给定作者的提交列表(针对特定存储库、分支)。可以获取最近对存储库和分支的提交(例如,mojombo 的 grit 存储库的主分支 JSON 格式:http://github.com/api/v2/json/commits/list/mojombo/grit/master)但我想知道是否可以按作者过滤它(希望这只是我错过的东西在文档中或可用但未记录)。

那么,有谁知道是否存在类似http://github.com/api/v2/:format/commits/list/mojombo/grit/master/:authorname 的东西(这显然不起作用)。我也愿意接受有关自己生成此类列表的建议(通过git 命令)。有任何想法吗?

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

【问题讨论】:

    标签: github


    【解决方案1】:

    2012 年 8 月更新

    按作者过滤提交已添加到v3 APIauthor 参数可用于 List commits on a repository 操作 (GET /repos/:user/:repo/commits)。

    将近三年后,感谢来自 Github 的永利!

    【讨论】:

    • 现在已弃用,您必须传递作者参数才能按作者过滤。
    【解决方案2】:

    使用 API 我认为除了获取提交列表和搜索用户之外没有其他方法。

    但是对于克隆的存储库 git log 有一个参数可以做到这一点:

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

    【讨论】:

      猜你喜欢
      • 2012-08-23
      • 1970-01-01
      • 2017-05-09
      • 1970-01-01
      • 2017-10-27
      • 1970-01-01
      • 1970-01-01
      • 2020-10-17
      • 1970-01-01
      相关资源
      最近更新 更多