Skip to content

Instantly share code, notes, and snippets.

@ybur-yug
Last active August 29, 2015 14:19
Show Gist options
  • Save ybur-yug/88722961fc030a35816b to your computer and use it in GitHub Desktop.
Save ybur-yug/88722961fc030a35816b to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
git rev-list --reverse HEAD | # get commits from latest to earliest
while read rev; do
echo; # print newline
echo REV $rev; # print REV some_hash
git ls-tree -r $rev | # recursively get all of the trees changed files
awk '{print $3}'| # get row 3 (shows entire changeset from commit)
xargs git show | # pipe to xargs
wc -l; # word count by line
done # YAY STATS
# output:
# REV b0ac8e8e11f7e63632cf5ae6495aacab5831d159
# 105
# REV f9b0f336bba3d90049242261e2dc4e9f0b17f639
# 208
# REV 8d5b14742e172a2f82ad9acfdefe816b5bbd5b4a
# 356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment