Hi
I have on my svn hook a script to run checkstyle and stop the commit
for some of the checks. It happens that I want to log also the
username trying to commit. At the momment this bit of the hook looks
like:
echo "RUNNING CHECKSTYLE" >> $CHECKSTYLE_LOG
CHANGED=`$SVNLOOK changed -t "$TXN" "$REPOS" | grep -v "^D" |\
awk '{print $2}'`
mkdir -p $TMPDIR
X=0
for LINE in $CHANGED ; do
#echo $CHANGED >> $CHECKSTYLE_LOG
FILE=`echo $LINE | egrep \\.java$ | egrep $INCLUDE | egrep -v
$EXCLUDE`
if [ -n "$FILE" ] ; then
$SVNLOOK cat $REPOS --transaction $TXN $FILE > $TMPDIR/tmpfile.java
echo `date`-"RUNNING CHECKSTYLE FOR $CHANGED" >> $CHECKSTYLE_LOG
$JAVA -jar $CHECKSTYLE -c $CHECKSTYLE_CONFIG $TMPDIR/tmpfile.java \
> $TMPDIR/tmpfile.checkstyle
X=$(($X + $?))
cat $TMPDIR/tmpfile.checkstyle |\
grep -v "^Starting audit...$\|^Audit done.$" |\
sed -e "s@$TMPDIR/tmpfile.java@$FILE@" \
>> $REPORT
fi
done
if [ $X -ne 0 ] ; then
cat $REPORT >> $CHECKSTYLE_LOG
echo "For more information visit here:
http://wiki:8090/wiki/index.php/Checkstyle_Rules " >> $REPORT
cat $REPORT > /dev/stderr
rm -Rf $TMPDIR
exit 1
fi
Is there any variable that returns the username?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-07-31 13:46:14 CEST