From c032d88ba780375a08e4388e3ee9ca08b05e0794 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 8 Aug 2007 14:20:57 +0000 Subject: 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 --- utils/warning-blame.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 utils/warning-blame.sh (limited to 'utils/warning-blame.sh') diff --git a/utils/warning-blame.sh b/utils/warning-blame.sh new file mode 100755 index 000000000..3630ac535 --- /dev/null +++ b/utils/warning-blame.sh @@ -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 -- cgit v1.2.3