I have a private repo on GitHub, which I can estimate the number of commits year-to-date is around 611 by looking at the Commits Graph. However, I cannot get that same number using the Octokit gem. I'm not sure if my results are rate limited, or page limited, or both.
require 'octokit'
client = Octokit::Client.new(login: 'myuser', password: 'mypassword', auto_traversal: true)
commits = client.list_commits('my-repo')
puts commits.size # 30 but should be 611
commits.each do |c|
puts "#{c.commit.committer.date}\t#{c.commit.message}\n"
end
Also, auto_traversal
doesn't seem to have any effect.
I'm not sure what the deal was with the octokit, though, I switched to the github_api gem and it works: