]> git.ozlabs.org Git - next-scripts/blobdiff - do_stats
update to_build_host a bit
[next-scripts] / do_stats
index 36012ceb6439796ce5d6cfa714b60c53f5c48149..3a4c4e821ca7143fa122f511a03848c31afd9d04 100755 (executable)
--- a/do_stats
+++ b/do_stats
@@ -1,9 +1,14 @@
 #!/bin/bash
 
+set -u
+
 base=$1
 next=$2
 rc=$3
 
+# to stabilise the sorts
+export LANG=C
+
 sd=../stats
 
 [ -d $sd ] || mkdir $sd || {
@@ -15,7 +20,7 @@ git rev-list --no-merges $base..$next | sort >$sd/$next.sha1s
 git rev-list --no-merges $base..$rc | sort >$sd/$rc.sha1s
 
 # filter out the common commits
-comm -12 $sd/$next.sha1s $sd/$rc.sha1s >$sd/common_sha1s
+comm -12 $sd/$next.sha1s $sd/$rc.sha1s >$sd/common_sha1
 comm -23 $sd/$next.sha1s $sd/$rc.sha1s >$sd/$next.sha1s.1
 comm -13 $sd/$next.sha1s $sd/$rc.sha1s >$sd/$rc.sha1s.1
 
@@ -44,3 +49,81 @@ join -v 1 -i -j 1 -t '|' $sd/$next.subj $sd/$rc.subj |
        sed 's/^.*|//' >$sd/$next.sha1s.3
 join -v 2 -i -j 1 -t '|' $sd/$next.subj $sd/$rc.subj |
        sed 's/^.*|//' >$sd/$rc.sha1s.3
+
+nrc=$(wc -l <$sd/$rc.sha1s)
+nnext=$(wc -l <$sd/$next.sha1s)
+ncommsha1=$(wc -l <$sd/common_sha1)
+ncommid=$(wc -l <$sd/common_id)
+ncommsubj=$(wc -l <$sd/common_subj)
+ncomm=$((ncommsha1+ncommid+ncommsubj))
+pcomm=$((ncomm*100/nrc))
+
+cat <<EOF
+Hi all,
+
+As usual, the executive friendly graph is at
+http://neuling.org/linux-next-size.html :-)
+
+(No merge commits counted, $next was the first linux-next after
+the merge window opened.)
+
+EOF
+printf "%-50s %5d\n" "Commits in $rc (relative to $base):" $nrc
+printf "%-50s %5d\n" "Commits in $next:" $nnext
+printf "%-50s %5d\n" "Commits with the same SHA1:" $ncommsha1
+printf "%-50s %5d (1)\n" "Commits with the same patch_id:" $ncommid
+printf "%-50s %5d (1)\n" "Commits with the same subject line:" $ncommsubj
+
+cat <<EOF
+
+(1) not counting those in the lines above.
+
+EOF
+
+printf "%-50s %5d %2d%%\n" "So commits in -rc1 that were in $next:" $ncomm $pcomm
+
+cat <<EOF
+
+Some breakdown of the list of extra commits (relative to $next)
+in -rc1:
+
+Top ten first word of commit summary:
+
+$(git log --no-walk --stdin --pretty="format:%s" <$sd/$rc.sha1s.3 |
+       sed -e 's/^\[//;s/[]:( /,;].*$//' |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+Top ten authors:
+
+$(git log --no-walk --stdin --pretty="format:%aE" <$sd/$rc.sha1s.3 |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+Top ten commiters:
+
+$(git log --no-walk --stdin --pretty="format:%cE" <$sd/$rc.sha1s.3 |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+There are also $(wc -l <$sd/$next.sha1s.3) commits in $next that didn't make it into
+$rc.
+
+Top ten first word of commit summary:
+
+$(git log --no-walk --stdin --pretty="format:%s" <$sd/$next.sha1s.3 |
+       sed -e 's/^\[//;s/[]:( /,;].*$//' |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+Top ten authors:
+
+$(git log --no-walk --stdin --pretty="format:%aE" <$sd/$next.sha1s.3 |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+Some of Andrew's patches are fixes for other patches in his tree (and
+have been merged into those).
+
+Top ten commiters:
+
+$(git log --no-walk --stdin --pretty="format:%cE" <$sd/$next.sha1s.3 |
+       tr 'A-Z' 'a-z' | sort | uniq -c | sort -nr | head -n 10)
+
+Those commits by me are from Andrew's mmotm tree.
+EOF