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
# Put this file in the root of your git repository then run `ruby blame.rb`. | |
# You will need gsed. You can install gsed with `brew install gsed`. | |
# Crazy shell script taken from http://stackoverflow.com/questions/4589731/git-blame-statistics | |
input = `git ls-tree -r HEAD|gsed -re 's/^.{53}//'|while read filename; do file "$filename"; done|grep -E ': .*text'|gsed -r -e 's/: .*//'|while read filename; do git blame "$filename"; done|gsed -r -e 's/.*\\((.*)[0-9]{4}-[0-9]{2}-[0-9]{2} .*/\\1/' -e 's/ +$//'|sort|uniq -c` | |
aggregated = {} | |
input.lines.each do |line| | |
line.strip! | |