From c3848721f0de6ae150013006bfb6d9224dea7006 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sat, 8 Feb 2014 19:47:40 -0600 Subject: [PATCH] add git-churn script --- bin/git-churn | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/git-churn diff --git a/bin/git-churn b/bin/git-churn new file mode 100755 index 0000000..ba39e0c --- /dev/null +++ b/bin/git-churn @@ -0,0 +1,23 @@ +#!/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 + +