From 9c7232afcf292b1224fd2e29db81bfd5fffb6beb Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Wed, 8 Feb 2012 07:59:19 -0800 Subject: [PATCH] Added --above to git-effort(1) --- Readme.md | 6 ++++++ bin/git-effort | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/Readme.md b/Readme.md index aec62a3..e48929d 100644 --- a/Readme.md +++ b/Readme.md @@ -171,6 +171,12 @@ $ git summary v42.. ![git effort](http://f.cl.ly/items/2B0D1x3v3w023s1r2t0g/Grab.png) + If you wish to ignore files with commits `<=` a value you may use `--above`: + +``` +$ git effort --above 5 +``` + ## git-repl GIT read-eval-print-loop: diff --git a/bin/git-effort b/bin/git-effort index 63a1622..c667c45 100755 --- a/bin/git-effort +++ b/bin/git-effort @@ -1,6 +1,11 @@ #!/bin/sh files=`git ls-files` +above='0' + +if test "$1" = "--above"; then + above=$2 +fi echo echo " file commits" @@ -10,6 +15,11 @@ for file in $files; do commits=`git log --oneline $file | wc -l` color='90' + if test $commits -le $above; then + continue + fi + + test $commits -gt 10 && color='33' test $commits -gt 25 && color='93' test $commits -gt 50 && color='32'