Skip to content

Instantly share code, notes, and snippets.

@DanielleSucher
Created June 5, 2013 18:12
Show Gist options
  • Save DanielleSucher/5715929 to your computer and use it in GitHub Desktop.
Save DanielleSucher/5715929 to your computer and use it in GitHub Desktop.
List all committers to a git repository, along with a count of their commits.
`git log --raw > authors.txt`
authors = Hash.new(0)
IO.readlines('authors.txt').each do |line|
if line.match /^Author:/
authors[line.gsub('Author: ', '').chomp] += 1
end
end
File.delete 'authors.txt'
authors.sort { |a,b| b[1] <=> a[1] }.each { |name, count| puts "#{name} - #{count}" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment