How can I get more than 100 results from GitHub API v3 using “github_api” gem?

后端 未结 3 441
失恋的感觉
失恋的感觉 2020-12-18 06:17

I\'m using GitHub API Gem and trying to get statistics about contributors\'s additions, deletions, and commit counts. The problem is that I get only 100 results and can\'t g

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-18 07:15

    Faced same issue, my solution was to fall back to git command line:

    Count commits:

    $ git log --author="X Y" --oneline --shortstat|wc -l
    224
    

    Count deltas:

    $ git log --author="X Y" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
    

    added lines: 1861, removed lines: 1243, total lines: 618

提交回复
热议问题