a script which will determine who was the last person to change a line which has a warning upon it (and a which revision)

svn path=/trunk/netsurf/; revision=3484
This commit is contained in:
Vincent Sanders 2007-08-08 14:20:57 +00:00
parent e2715b4f2f
commit c032d88ba7

36
utils/warning-blame.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
# where to store the processed list of warnings
WARNING_LIST=/tmp/warning-list
if [ $# -gt 1 ]; then
if [ -f $1 ]; then
cp $1 ${WARNING_LIST}
else
echo "Need a valid warning file"
exit 1
fi
else
make clean 2>&1 >/dev/null
make nsgtk 2>&1 |grep "warning:" | sort | uniq > ${WARNING_LIST}
fi
for blamefile in $(cat ${WARNING_LIST} | cut -f 1 -d ':' | sort | uniq ); do
if [ -f ${blamefile} ]; then
svn blame ${blamefile} >/tmp/blame
cat ${WARNING_LIST} | grep "^${blamefile}" >/tmp/blame-warnings
while read warning; do
echo ${warning}
lineno=$(echo ${warning} | cut -f 2 -d ':' ; )
cat /tmp/blame | head -n ${lineno} | tail -n 1
done < /tmp/blame-warnings
rm /tmp/blame-warnings
else
echo "Unable to find ${blamefile}"
fi
done