Get commits list of a repository


Ok, so I’m using the Atom API to get a list of repository and then a list of it’s heads via this:

var repos = atom.project.getRepositories();
var heads = [];

repos.forEach(function (repo) {

But so far I haven’t found a way to get a list of the commits for each of those heads. getReferences only returns an array of heads, remotes and tags.

Also, the only reference I see in the Atom API about git is in and I can’t seem to find any references of “commit” in there. Is this not implemented yet or am I missing something?



Not implementing all parts of Git through the Atom API was a specific choice that the Atom team made:

But packages are welcome to add their own Git support.



Check out the Git-log package. It’s doing a pretty good job at visualizing the git history of a repository so its code should give you some clues.



Thanks you both for the replies, it’s kinda sad we don’t have build-in support but it’s understandable.

I ended up writing something like this:



That’s cool.
I haven’t tried it out, but if it works that’s certainly one way to construct a nice list of commits to work on.

I suppose one could also make use of some npm package for git.