'release' arg as shortcut for most-recent-tag

for project_stats script
This commit is contained in:
Roland Walker 2014-01-20 20:39:56 -05:00
parent 44dfc1421a
commit 34b17e58ad
1 changed files with 8 additions and 2 deletions

View File

@ -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"