Browse Source

add args to release_stats.sh

pull/11607/head
Jeff Reback 7 years ago
parent
commit
5823a6d4af
  1. 43
      release_stats.sh

43
release_stats.sh

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

Loading…
Cancel
Save