Skip to content

Commit 5823a6d

Browse files
committed
add args to release_stats.sh
1 parent 9620597 commit 5823a6d

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

release_stats.sh

+35-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
1-
#!/bin/sh
2-
3-
LAST=`git tag --sort v:refname | grep -v rc | tail -1`
4-
START=`git log $LAST.. --simplify-by-decoration --pretty="format:%ai %d" | tail -1 | gawk '{ print $1 }'`
5-
END=`git log $LAST.. --simplify-by-decoration --pretty="format:%ai %d" | head -1 | gawk '{ print $1 }'`
6-
7-
git log $LAST.. --format='%an#%s' | grep -v Merge > commits
1+
#!/bin/bash
2+
3+
while [[ $# > 1 ]]
4+
do
5+
key="$1"
6+
7+
case $key in
8+
--from)
9+
FROM="$2"
10+
shift # past argument
11+
;;
12+
--to)
13+
TO="$2"
14+
shift # past argument
15+
;;
16+
*)
17+
# unknown option
18+
;;
19+
esac
20+
shift # past argument or value
21+
done
22+
23+
if [ -z "$FROM" ]; then
24+
FROM=`git tag --sort v:refname | grep -v rc | tail -1`
25+
fi
26+
27+
if [ -z "$TO" ]; then
28+
TO=""
29+
fi
30+
31+
START=`git log $FROM.. --simplify-by-decoration --pretty="format:%ai %d" | tail -1 | gawk '{ print $1 }'`
32+
END=`git log $TO.. --simplify-by-decoration --pretty="format:%ai %d" | head -1 | gawk '{ print $1 }'`
33+
34+
git log $FROM.. --format='%an#%s' | grep -v Merge > commits
835

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

12-
echo "Stats since <$LAST> [$START - $END]"
39+
echo "Stats since <$FROM> [$START - $END]"
1340
echo ""
1441

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

0 commit comments

Comments
 (0)