Created
August 24, 2018 16:24
-
-
Save ksm/ae31e21b00574594da4ea5e342cb4efd to your computer and use it in GitHub Desktop.
Git Churn via https://github.com/garybernhardt/dotfiles/blob/f0c0ff92209e5aed4fa3ef6faf056eb9944a8f12/bin/git-churn
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/bash | |
# | |
# Written by Corey Haines | |
# Scriptified by Gary Bernhardt | |
# | |
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it | |
# and you'll be able to do `git churn`. | |
# | |
# 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:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' | sort -g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment