Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active January 4, 2016 13:58
Show Gist options
  • Save commuterjoy/8630934 to your computer and use it in GitHub Desktop.
Save commuterjoy/8630934 to your computer and use it in GitHub Desktop.
Generates a tab-separated file with git "files changed, chars inserted, chars deleted"
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | grep -v 'Merge pull' | cut -f 1 > all
ruby -e 'STDIN.read.split("\n").each{|a| puts "git show --shortstat #{a}"}' < all | /bin/sh | egrep '(files|file) changed' > all-commits
cat all-commits | ruby -e 'STDIN.read.split("\n").map{|a| a.scan(/\d+/).map{|b|b.to_i} }.each{|c| puts c.join("\t") }' > all-commits.tsv
@commuterjoy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment