2013-05-29 18:25:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
projects=$1
|
|
|
|
all=0
|
|
|
|
|
|
|
|
if [ "$projects" = "" ] ; then
|
2013-05-29 20:12:37 +00:00
|
|
|
projects=projects/*.json
|
2013-05-29 18:25:31 +00:00
|
|
|
all=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p results
|
|
|
|
|
2013-07-09 20:19:03 +00:00
|
|
|
rm -f results/*-openreviews*
|
|
|
|
rm -f results/*-openapproved*
|
2013-06-24 16:24:36 +00:00
|
|
|
|
2013-10-07 17:15:50 +00:00
|
|
|
if [ -n "${GERRIT_USER}" ] ; then
|
|
|
|
EXTRA_ARGS="-u ${GERRIT_USER}"
|
|
|
|
fi
|
|
|
|
|
2013-10-07 19:03:48 +00:00
|
|
|
metadata() {
|
|
|
|
date -u
|
|
|
|
echo -n "reviewstats HEAD: "
|
|
|
|
git rev-parse HEAD
|
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2013-05-29 18:25:31 +00:00
|
|
|
for project in ${projects} ; do
|
2013-05-29 20:12:37 +00:00
|
|
|
project_base=$(basename $(echo ${project} | cut -f1 -d'.'))
|
2014-02-09 23:13:50 +00:00
|
|
|
(metadata && openreviews -p ${project} -l 15 ${EXTRA_ARGS}) > results/${project_base}-openreviews.txt
|
|
|
|
openreviews -p ${project} --html -l 15 ${EXTRA_ARGS} > results/${project_base}-openreviews.html
|
2013-11-25 07:13:29 +00:00
|
|
|
(metadata && openapproved -p ${project} ${EXTRA_ARGS}) > results/${project_base}-openapproved.txt
|
2013-05-29 18:25:31 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${all}" = "1" ] ; then
|
2013-11-25 07:18:29 +00:00
|
|
|
(metadata && openreviews -a ${EXTRA_ARGS}) > results/all-openreviews.txt.tmp
|
2013-05-31 21:36:38 +00:00
|
|
|
for f in results/*-openreviews.txt ; do
|
|
|
|
(echo && cat $f) >> results/all-openreviews.txt.tmp
|
|
|
|
done
|
|
|
|
mv results/all-openreviews.txt.tmp results/all-openreviews.txt
|
2013-11-25 07:18:29 +00:00
|
|
|
openreviews -a --html ${EXTRA_ARGS} | grep -v '</html>' > results/all-openreviews.html.tmp
|
2013-06-28 02:15:58 +00:00
|
|
|
for f in results/*-openreviews.html ; do
|
|
|
|
cat $f | grep -v 'html>' | grep -v 'head>' >> results/all-openreviews.html.tmp
|
|
|
|
done
|
|
|
|
echo "</html>" >> results/all-openreviews.html.tmp
|
|
|
|
mv results/all-openreviews.html.tmp results/all-openreviews.html
|
2013-05-29 18:25:31 +00:00
|
|
|
|
2013-11-25 07:13:29 +00:00
|
|
|
(metadata && openapproved -a ${EXTRA_ARGS}) > results/all-openapproved.txt
|
2013-05-29 18:25:31 +00:00
|
|
|
fi
|