Skip to content

Commit

Permalink
add args to release_stats.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Nov 20, 2015
1 parent 9620597 commit 5823a6d
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions release_stats.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
#!/bin/sh

LAST=`git tag --sort v:refname | grep -v rc | tail -1`
START=`git log $LAST.. --simplify-by-decoration --pretty="format:%ai %d" | tail -1 | gawk '{ print $1 }'`
END=`git log $LAST.. --simplify-by-decoration --pretty="format:%ai %d" | head -1 | gawk '{ print $1 }'`

git log $LAST.. --format='%an#%s' | grep -v Merge > commits
#!/bin/bash

while [[ $# > 1 ]]
do
key="$1"

case $key in
--from)
FROM="$2"
shift # past argument
;;
--to)
TO="$2"
shift # past argument
;;
*)
# unknown option
;;
esac
shift # past argument or value
done

if [ -z "$FROM" ]; then
FROM=`git tag --sort v:refname | grep -v rc | tail -1`
fi

if [ -z "$TO" ]; then
TO=""
fi

START=`git log $FROM.. --simplify-by-decoration --pretty="format:%ai %d" | tail -1 | gawk '{ print $1 }'`
END=`git log $TO.. --simplify-by-decoration --pretty="format:%ai %d" | head -1 | gawk '{ print $1 }'`

git log $FROM.. --format='%an#%s' | grep -v Merge > commits

# Include a summary by contributor in release notes:
# cat commits | gawk -F '#' '{ print "- " $1 }' | sort | uniq

echo "Stats since <$LAST> [$START - $END]"
echo "Stats since <$FROM> [$START - $END]"
echo ""

AUTHORS=`cat commits | gawk -F '#' '{ print $1 }' | sort | uniq | wc -l`
Expand Down

0 comments on commit 5823a6d

Please sign in to comment.