]> git.ozlabs.org Git - next-scripts/commitdiff
some updates
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 1 Apr 2009 05:52:43 +0000 (16:52 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 1 Apr 2009 05:52:43 +0000 (16:52 +1100)
summary

diff --git a/summary b/summary
index 1aa48668d25fdecc1b8e47fa5c60150688db4de7..466c326e750ffe46acd0be06c9e60be6a71adba4 100755 (executable)
--- a/summary
+++ b/summary
@@ -1,6 +1,9 @@
 #!/bin/bash --norc
 
-LOG_FILE="../summary"
+d="$1"
+prev="$2"
+
+LOG_FILE="../stats/next-$d-summary"
 
 cp /dev/null $LOG_FILE
 
@@ -9,6 +12,11 @@ log()
        echo "$@" | tee -a $LOG_FILE
 }
 
+plog()
+{
+       printf "$@" | tee -a $LOG_FILE
+}
+
 patch_and_sha_ids()
 {
        echo "$*" | xargs -r -n 1 git diff-tree -p | git patch-id | sort
@@ -19,24 +27,52 @@ patch_ids()
        patch_and_sha_ids "$@" | cut -d' ' -f1
 }
 
-heads=$(grep -v '^#' ../real_control | awk -F '        ' '$2=="quilt" { printf("quilt/%s ", $3); } $2=="git" { printf("%s/%s ", $3, $5); }')
+trees=$(grep -v '^#' ../real_control | awk -F '        ' '{ printf("%s ", $3); }')
 
 seen_ids=""
 seen_heads=""
 seen_sha1s=""
 
-for h in $heads; do
+plog '%-20s %7s' "Tree" "commits"
+[ "$prev" ] &&
+       plog ' %s' "since next-$prev"
+plog '\n\n'
+
+for t in $trees; do
+
+       [ "$t" = "origin" ] &&
+               continue
+
+       [ "$prev" ] && {
+               prev_num=$(egrep "^$t +[0-9]+" "../stats/next-$prev-summary")
+               if [ "$prev_num" ]; then
+                       prev_num=$(expr "$prev_num" : "[^ ]*  *\([0-9]*\).*")
+               else
+                       prev_num=0
+               fi
+       }
+
+       h="next-$d/$t"
+       git rev-parse --verify "$h" >/dev/null 2>&1 ||
+               continue
+
        mb=$(git merge-base origin/master $h)
        rh=$(git rev-parse $h)
        [ "$mb" = "$rh" ] && {
-               log $h
+               plog '%-20s %7d' $t 0
+               [ "$prev" ] &&
+                       plog ' %+7d' $((0 - prev_num))
+               plog '\n'
                continue
        }
 
        c=$(git rev-list --no-merges $mb...$rh $seen_heads | sort)
        seen_heads="$seen_heads ^$rh"
        [ -z "$c" ] && {
-               log $h
+               plog '%-20s %7d' $t 0
+               [ "$prev" ] &&
+                       plog ' %+7d' $((0 - prev_num))
+               plog '\n'
                continue
        }
 
@@ -44,14 +80,20 @@ for h in $heads; do
 
        is=$(patch_and_sha_ids $c)
 #      is=$(join -v 1 <(echo "$is") <(echo "$origin_ids"))
-       is=$(join -v 1 <(echo "$is") ../origin1.ids)
+       is=$(echo "$is" | join -v 1 - "../stats/origin1-$d.ids")
        is=$(join -v 1 <(echo "$is") <(echo "$seen_ids"))
        c1=$(echo "$is" | cut -d' ' -f2)
-       [ "$is" ] && seen_ids=$( (echo "$seen_ids"; echo "$is" | cut -d' ' -f1) | sort)
-
-       log $h \($(echo "$c" | wc -w) $(echo "$c1" | wc -w)\)
+       [ "$is" ] &&
+               seen_ids=$( (echo "$seen_ids"; echo "$is" | cut -d' ' -f1) | sort)
 
        seen_sha1s="$seen_sha1s $c1"
+
+#      log $t \($(echo "$c" | wc -w) $(echo "$c1" | wc -w)\)
+       num=$(echo "$c1" | wc -w)
+       plog '%-20s %7d' $t $num
+       [ "$prev" ] &&
+               plog ' %+7d' $((num - prev_num))
+       plog '\n'
 done
 
 log