Skip to content

Commit

Permalink
add summary script so i can see progress and authorship
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed May 28, 2010
1 parent 4176f19 commit b36d672
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions summary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env ruby
#

command = ARGV[0]
exclude = ['figures', 'figures-dia', 'figures-source', 'couchapp', 'latex', 'pdf', 'epub', 'en']

data = []
Dir.glob("*").each do |dir|
if !File.file?(dir) && !exclude.include?(dir)
lines = `git diff-tree -r -p master:en master:#{dir} | grep '^+' | wc -l`.strip.to_i
last_commit = `git log -1 --no-merges --format="%ar" #{dir}`.chomp
authors = ""
if command == 'authors'
authors = `git shortlog --no-merges -s -n #{dir}`.chomp
end
data << [dir, lines, authors, last_commit]
end
end

d = data.sort { |a, b| b[1] <=> a[1] }
d.each do |dir, lines, authors, last|
puts "#{dir.ljust(10)} - #{lines} (#{last})"
if command == 'authors'
puts "Authors: #{authors.split("\n").size}"
puts authors
puts
end
end

0 comments on commit b36d672

Please sign in to comment.