reviewstats/genresults-reviewers.sh
Russell Bryant 52b26e253b generate reviewers stats for 1 and 3 years
Change-Id: Ib274166b49877838a1db20fcd84605c1bfc6b981
2013-11-03 13:06:52 +08:00

38 lines
782 B
Bash
Executable File

#!/bin/bash
projects=$1
all=0
if [ "$projects" = "" ] ; then
projects=projects/*.json
all=1
fi
mkdir -p results
rm -f results/*-reviewers-*
if [ -n "${GERRIT_USER}" ] ; then
EXTRA_ARGS="-u ${GERRIT_USER}"
fi
metadata() {
date -u
echo -n "reviewstats HEAD: "
git rev-parse HEAD
echo
}
for project in ${projects} ; do
project_base=$(basename $(echo ${project} | cut -f1 -d'.'))
for time in 30 60 90 180 365 1095; do
(metadata && ./reviewers.py -p ${project} -d ${time} ${EXTRA_ARGS} -o results/${project_base}-reviewers-${time} --outputs txt --outputs csv)
done
done
if [ "${all}" = "1" ] ; then
for time in 30 60 90 180 365 1095; do
(metadata && ./reviewers.py -a -d ${time} ${EXTRA_ARGS} -o results/all-reviewers-${time} --outputs txt --outputs csv)
done
fi