Here is a simple ruby script that I used to get the author, added lines, deleted lines, and commit count from git. It does not cover fixation over time.
Please note that I have a trick when it ignores the commit, which adds / removes more than 10,000 lines, because I assume it is importing some kind of code, feel free to modify the logic for your needs. You can put below in a file called gitstats-simple.rb and then run
git log
gitstats-simple.rb content
#!/usr/bin/ruby # takes the output of this on stdin: git log --numstat --prety='%an' map = Hash.new{|h,k| h[k] = [0,0,0]} who = nil memo = nil STDIN.read.split("\n").each do |line| parts = line.split next if parts.size == 0 if parts[0].match(/[az]+/) if who && memo[0] + memo[1] < 2000 map[who][0] += memo[0] map[who][1] += memo[1] map[who][2] += 1 end who = parts[0] memo = [0,0] next end if who memo[0]+=line[0].to_i memo[1]+=parts[1].to_i end end puts map.to_a.map{|x| [x[0], x[1][0], x[1][1], x[1][2]]}.sort_by{|x| -x[1] - x[2]}.map{|x|x.inspect.gsub("[", "").gsub("]","")}.join("\n")
Cliff Frey Sep 14 '13 at 3:12 2013-09-14 03:12
source share