git review stats
authorAndrew Tridgell <tridge@samba.org>
Thu, 7 Apr 2011 02:27:05 +0000 (12:27 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 7 Apr 2011 02:27:05 +0000 (12:27 +1000)
review_stats.sh [new file with mode: 0755]

diff --git a/review_stats.sh b/review_stats.sh
new file mode 100755 (executable)
index 0000000..ccf9418
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ $# -ge 1 ]; then
+    n="$1"
+else
+    n=1
+fi
+
+if [ $# -ge 2 ]; then
+    committers="$2"
+else
+    committers=$(git log --since="$n months ago" |grep ^Author| sort -u | cut -d'<' -f2 | cut -d'>' -f1)
+fi
+
+for c in $committers; do
+    patch_count=$(git log --since="$n months ago" --author="$c" |grep ^Author|wc -l)
+    review_count=$(git log --since="$n months ago" --author="$c" |egrep 'Signed.off|Review|Pair.Programmed' |wc -l)
+    review_pct=$(expr 100 \* $review_count / $patch_count)
+    echo "$review_pct% $patch_count $review_count $c"
+done