Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github API - commits by author

Tags:

github

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 command). Any ideas?

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

like image 538
salathe Avatar asked Nov 06 '09 14:11

salathe


People also ask

Why are my commits not showing up on GitHub?

Your local Git commit email isn't connected to your account Commits must be made with an email address that is connected to your account on GitHub.com, or the GitHub-provided noreply email address provided to you in your email settings, in order to appear on your contributions graph.

Where can I see commits in GitHub?

On GitHub.com, navigate to the main page of the repository. On the main page of the repository, click commits to navigate to the commits page. Navigate to the commit by clicking the commit message link. To see what branch the commit is on, check the label below the commit message.

How do I commit a developer on GitHub?

Commit your changesType a commit message describing the change you've made. To commit your staged changes, click the check mark at the top the source control side bar. Once you have committed your changes, they will automatically be pushed to your branch on GitHub.

What is the difference between push and commit?

Basically, git commit "records changes to the repository" while git push "updates remote refs along with associated objects". So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository.


2 Answers

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!

like image 116
salathe Avatar answered Oct 20 '22 10:10

salathe


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).
like image 40
Mihai A Avatar answered Oct 20 '22 10:10

Mihai A