Search code examples
githubcommitgithub-apigit-commit

Filter commits by a unique user


I am using GitHub API v3. I want to filter the commits in a repository to ones which are committed by a specific author. I used following API to do this. While it does not work always.

https://api.github.com/repos/:owner/:repo/commits?author=:author&page=1&per_page=100

for instance, for the following one.

https://api.github.com/repos/mtreinish/linux/commits?author=mtreinish&page=1&per_page=100

In that case, it returns following results.

{
  "message": "Server Error",
  "documentation_url": "https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository"
}

Could you please help me to resolve the problem.


Solution

  • Your request is getting a 500 Internal Server Error from GitHub. That means that the server encountered an error of some sort and was unable to service your request.

    In this particular case, it looks like what you're encountering is a timeout: that is, your request cannot be satisfied in an reasonable amount of time because the history is too large and commits by that author aren't common enough that it can provide the requested number of answers. GitHub is limited by the fact that history traversal is a single-threaded operation and Git can only do it so fast.

    You can contact GitHub Support and ask them to see if there's anything that can be done, but as a practical matter, you're probably better off cloning the repository and performing your request using the git command-line tool.