Created
July 21, 2013 22:40
-
-
Save dotemacs/6050293 to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| # | |
| # Originally written by Corey Haines | |
| # Scriptified by Gary Bernhardt | |
| # | |
| # Tweaked by me, @dotemacs: | |
| # - changed it from Bash to Bourne shell | |
| # - made the files with most churn print first | |
| # - improved the sort/uniq flow | |
| # | |
| # Show churn for whole repo: | |
| # $ git churn | |
| # | |
| # Show churn for specific directories: | |
| # $ git churn app lib | |
| # | |
| # Show churn for a time range: | |
| # $ git churn --since='1 month ago' | |
| # | |
| # (These are all standard arguments to `git log`.) | |
| set -e | |
| git log --all -M -C --name-only --format='format:' "$@" | \ | |
| grep -v '^$' | sort | uniq -c | sort -rn | \ | |
| awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment