From 33e554b7f207be2f6ee2048b54c5e5c5b1251dde Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Wed, 3 Feb 2016 10:12:26 -0600 Subject: [PATCH] consolidate git-churn into gitconfig --- bin/git-churn | 23 ----------------------- git/gitconfig.symlink | 5 +++++ 2 files changed, 5 insertions(+), 23 deletions(-) delete mode 100755 bin/git-churn diff --git a/bin/git-churn b/bin/git-churn deleted file mode 100755 index ba39e0c..0000000 --- a/bin/git-churn +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 - - diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink index 68c5659..f9781d5 100644 --- a/git/gitconfig.symlink +++ b/git/gitconfig.symlink @@ -24,6 +24,10 @@ day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'" # order files by number of commits, ascending + # Written by Corey Haines + # Scriptified by Gary Bernhardt + # Show churn for a time range: + # $ git churn --since='1 month ago' churn = "!f() { 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; }; f" # show all deleted files in the repo @@ -120,6 +124,7 @@ excludesfile = ~/.gitignore_global pager = less -FXRS -x2 editor = vim + whitespace = cr-at-eol [rerere] enabled = true [gitsh]