Skip to content

Instantly share code, notes, and snippets.

@gerad
Created April 27, 2012 02:20
Show Gist options
  • Save gerad/2505146 to your computer and use it in GitHub Desktop.
Save gerad/2505146 to your computer and use it in GitHub Desktop.
git authors over time
require 'set'
require 'date'
author = nil
authors = {}
`git log`.split("\n").reverse.each do |line|
if line.match(/^Author:\s+(.*)$/)
author = $1
end
if line.match(/^Date:\s+(.*)$/)
date = Date.parse $1
if author && date
if authors[author].nil? || authors[author] > date
authors[author] = date
end
end
author = nil
end
end
i = 0
authors.sort_by { |k, v| v }.each do |author, date|
i += 1
puts "#{date}\t#{i}" #\t#{author}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment