I'd like to count the commits of 2012 in http://github.com/plone and http://github.com/collective
Are there any tools to do this - provide statistics for Github organizations?
Do I need to write my own script to scrape the repositories, check out them individually and count commits?
Here is how I'd do it:
git clone --bare; only the git info, no working copy. This creates a
plone.event.gitif you cloned
git --git-dir=<git_directory> rev-list HEAD --count; outputs the count to stdout, so
subprocess.check_output()should do the job just fine.
That only requires 2 API calls, so you avoid being rate limited; paging through all the commits with the API would require too many requests to count all the repository commits, checking out a bare repository copy would be faster anyway.