From 34b17e58ad98edbf22d606157c650402ad5c34ef Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Mon, 20 Jan 2014 20:39:56 -0500 Subject: [PATCH] 'release' arg as shortcut for most-recent-tag for project_stats script --- developer/bin/project_stats | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/developer/bin/project_stats b/developer/bin/project_stats index bfa608b2ef..4feed2e1d7 100755 --- a/developer/bin/project_stats +++ b/developer/bin/project_stats @@ -40,6 +40,9 @@ Usage: With optional single argument, (eg a tag or commit-hash) show statistics since that commit object. + Use the special argument 'release' to calculate since the + most recent tag (usually the same as the last release). + Without argument, show statistics since first commit. " @@ -52,9 +55,12 @@ if [[ "$branch" != "master" ]]; then fi printf "Unique contributors" -if [[ -n "$1" ]]; then +if [[ "$1" = 'release' ]]; then + start_object="$(git describe --tags --abbrev=0)" + printf " since $start_object" +elif [[ -n "$1" ]]; then start_object="$1" - printf " since $1" + printf " since $start_object" fi printf "\n"