Created
April 25, 2012 08:36
-
-
Save brianjriddle/2488228 to your computer and use it in GitHub Desktop.
what happened and when in a git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
git_dir=ARGV[0].nil? ? "." : ARGV[0] | |
since=ARGV[1].nil? ? 7: ARGV[1] | |
git_log = "" | |
Dir.chdir(git_dir) do | |
git_log = %x{git log --since="#{since} days ago" --format=%an | sort | uniq -c} | |
end | |
git_data = git_log.split("\n") | |
total_authors = git_data.size | |
total_commits = 0 | |
git_data.each do |data| | |
commits, author = data.split("\s") | |
total_commits += commits.strip.to_i | |
end | |
puts "In the last #{since} days #{total_authors} developers have made #{total_commits} commits to #{git_dir}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment