Slides from my talk at BT DevCon9, 13 Feb 2015.
The final commands built up in the worked examples were:
# Find distribution of number of files changed by git commits
git log --oneline | cut -d' ' -f1 | while read sha ; do git show --stat $sha | grep -c [-+]$ ; done | sort -n | uniq -c
# Count references to each class in project
awk '/^ *class / { print $2 } /Struct.new/ { print $1 }' app/**/*.rb | while read class ; do echo -n $class " " ; cat app/**/*.rb | grep -c "\b$class\b" ; done | awk '$2 > 1 { print $2 - 1 " " $1 }' | sort -rn