Skip to content

Instantly share code, notes, and snippets.

@tcrayford
Created December 25, 2010 22:04
Show Gist options
  • Save tcrayford/755075 to your computer and use it in GitHub Desktop.
Save tcrayford/755075 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
freqs = Hash.new(0)
commits = `git log --pretty=oneline --abbrev-commit`.split("\n").map do |line|
line.split(" ")[0]
end
commits.map do |sha|
`git show --pretty="format:" --name-only #{sha}`
end[1..-1].map do |files|
files.split("\n").each do |file|
freqs[file] = freqs[file] + 1
end
end
output = ""
freqs.each_pair do |key, value|
output = output + "\n" + value.to_s + ": " +key
end
puts `echo "#{output}" | sort`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment