From e5653a4addbf02aab8982a61b4164a77db1402c0 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 19 May 2009 18:32:53 +1000 Subject: [PATCH] Add totals to summaries --- summary | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/summary b/summary index b5fc287..00da3b8 100755 --- a/summary +++ b/summary @@ -32,6 +32,8 @@ trees=$(grep -v '^#' ../real_control | awk -F ' ' '{ printf("%s ", $3); }') seen_ids="" seen_heads="" seen_sha1s="" +total_commits=0 +total_diff=0 plog '%-20s %7s' "Tree" "commits" [ "$prev" ] && @@ -60,8 +62,10 @@ for t in $trees; do rh=$(git rev-parse $h) [ "$mb" = "$rh" ] && { plog '%-20s %7d' $t 0 - [ "$prev" ] && + [ "$prev" ] && { plog ' %+7d' $((0 - prev_num)) + total_diff=$((total_diff - prev_num)) + } plog '\n' continue } @@ -70,8 +74,10 @@ for t in $trees; do seen_heads="$seen_heads ^$rh" [ -z "$c" ] && { plog '%-20s %7d' $t 0 - [ "$prev" ] && + [ "$prev" ] && { plog ' %+7d' $((0 - prev_num)) + total_diff=$((total_diff - prev_num)) + } plog '\n' continue } @@ -91,11 +97,21 @@ for t in $trees; do # log $t \($(echo "$c" | wc -w) $(echo "$c1" | wc -w)\) num=$(echo "$c1" | wc -w) plog '%-20s %7d' $t $num - [ "$prev" ] && + [ "$prev" ] && { plog ' %+7d' $((num - prev_num)) + total_diff=$((total_diff + num - prev_num)) + } plog '\n' + + total_commits=$((total_commits + num)) done +log +plog '%-20s %7d' 'Total' $total_commits +[ "$prev" ] && + plog ' %+7d' $total_diff +plog '\n' + log git shortlog --no-walk $seen_sha1s 2>&1 | tee -a $LOG_FILE -- 2.39.5