summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2007-08-08 14:20:57 +0000
committerVincent Sanders <vince@netsurf-browser.org>2007-08-08 14:20:57 +0000
commitc032d88ba780375a08e4388e3ee9ca08b05e0794 (patch)
treed6314d0362949932444c698edf7f76a0eac87952 /utils
parente2715b4f2fe0fdd0ee9759886cd9b6c7657c1557 (diff)
downloadnetsurf-c032d88ba780375a08e4388e3ee9ca08b05e0794.tar.gz
netsurf-c032d88ba780375a08e4388e3ee9ca08b05e0794.tar.bz2
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
Diffstat (limited to 'utils')
-rwxr-xr-xutils/warning-blame.sh36
1 files changed, 36 insertions, 0 deletions
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