Last active
December 28, 2015 20:49
-
-
Save seangeo/7559807 to your computer and use it in GitHub Desktop.
Generate a histogram of file churn in a git repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This was created by smashing together two scripts. One from Gary Bernhardt and one from Small Labs. | |
# | |
# See also https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn | |
# And http://www.smallmeans.com/notes/shell-history/ | |
# | |
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk '{print $1 "\t" $2}' | sort -g | awk '{print $1}' | uniq -c | sort -rn --stable | awk '!max{max=$1;}{r="";i=s=60*$1/max;while(i-->0)r=r"#";printf "%15s files changed %5d times %s %s",$1,$2,r,"\n";}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment