From fd72edd98fd86fab605477833ac5cdb4ef21d141 Mon Sep 17 00:00:00 2001 From: Nicolai Skogheim Date: Tue, 7 Jul 2015 18:46:12 +0200 Subject: [PATCH] effort: allow sending options to log. Fix #326 --- bin/git-effort | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/bin/git-effort b/bin/git-effort index 45cfd2ff1..6a539dba8 100755 --- a/bin/git-effort +++ b/bin/git-effort @@ -107,12 +107,32 @@ sort_effort() { < $tmp sort -rn -k 2 } -# --above - -if test "$1" = "--above"; then - shift; above=$1 +# +# parse arguments +# we handle --above, and send the rest to git log +# +while [[ $# > 0 ]] ; do + key=$1 + declare -a log_args + + case $key in + --above) + shift; above=$1 + ;; + --*) + log_args+=$1 + ;; + --) + shift + break # files from here on + ;; + *) + break # files from here on + ;; + esac shift -fi +done + # [file ...]