From 48df113999c93fcd3ebd1a13e6f25ea334d26de4 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Mon, 18 Feb 2013 10:43:36 +0100 Subject: [PATCH] Script that generates statistics for release notes --- scripts/release_stats.sh | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 scripts/release_stats.sh diff --git a/scripts/release_stats.sh b/scripts/release_stats.sh new file mode 100755 index 0000000000..f9b9546c30 --- /dev/null +++ b/scripts/release_stats.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash +# +# Generates statistics for release notes +# + +# get the source location for this script; handles symlinks +function get_script_path { + local source="${BASH_SOURCE[0]}" + while [ -h "${source}" ] ; do + source="$(readlink "${source}")"; + done + echo ${source} +} + +# path, name, and dir for this script +declare -r script_path=$(get_script_path) +declare -r script_name=$(basename "${script_path}") +declare -r script_dir="$(cd -P "$(dirname "${script_path}")" && pwd)" + +# print usage info +function usage { + echo "Usage: ${script_name} v2.1.0..v2.2.0 path_to_assembla_export.csv" +} + +declare -r tag1=$1 +declare -r tag2=$2 +declare -r tickets_csv=$3 + +if [ -z "$tickets_csv" ]; then + usage + exit 1 +fi + +declare -r tag_range="$tag1..$tag2" +declare authors=$($script_dir/authors.pl $tag_range) +declare author_count=$(echo "$authors" | wc -l | grep -o '[1-9].*') +declare diff_short=$(git diff --shortstat $tag_range | grep -o '[1-9].*') +declare tickets=$(tail -n +2 $tickets_csv | grep Fixed | cut -d ',' -f 1,2 | sed 's/","/ /g' | tr -d '"' | sort -n) +declare ticket_count=$(echo "$tickets" | wc -l | grep -o '[1-9].*') + +echo "$tag1 compared to Akka $tag2": + +echo "* $ticket_count tickets closed" + +echo "* $diff_short" + +echo "* X pages of docs vs Y in $tag1" + +echo "* … and a total of $author_count committers!" + +echo "" +echo "Fixed Tickets:" +echo "$tickets" + +echo "" +echo "Credits:" +echo "commits added removed" +echo "$authors" + +