]> git.ozlabs.org Git - next-scripts/commitdiff
fetch_trees: skip the "branch" control lines
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 6 Jun 2018 01:26:17 +0000 (11:26 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 6 Jun 2018 01:26:17 +0000 (11:26 +1000)
check_left
fetch_trees

index 1e1a7493bad88640cb982899d7aae2395673802b..079d6997c40d370a93ba0f30a2027898af901d10 100755 (executable)
@@ -5,6 +5,7 @@ LOG_FILE="../left_over.log"
 cp /dev/null "$LOG_FILE"
 
 heads=$(awk -F '\t' '/^#/ {next;} { printf("%s/%s ", $3, $5); }' ../etc/control)
+prev_heads=""
 
 total=0
 
@@ -25,16 +26,22 @@ for h in $heads; do
 #      c=$(git rev-list --no-merges origin/master.."$h")
 #      [ -z "$c" ] &&
 #              continue
-       count=$(git rev-list --count --no-merges "$base".."$h")
+       count=$(git rev-list --count --no-merges $prev_heads  "$base".."$h")
        [ "$count" == 0 ] &&
                continue
 
-       echo "$h" "$count" | tee -a "$LOG_FILE"
+       total=$(( $total + $count ))
+       echo | tee -a "$LOG_FILE"
+       echo "${h%%/*}" "$count" | tee -a "$LOG_FILE"
+       echo | tee -a "$LOG_FILE"
 #      git shortlog --no-walk "$c" 2>&1 | tee -a "$LOG_FILE"
-       git log --oneline --no-merges "$base".."$h" | tee -a "$LOG_FILE"
+       git log --oneline --no-merges $prev_heads "$base".."$h" | tee -a "$LOG_FILE"
 
 #      gitk stable..$h
-
+       prev_heads="$prev_heads ^$h"
 done
 
+echo | tee -a "$LOG_FILE"
+echo "Total $total"
+
 exit 0
index 88efd947fb3c2517cb238208adfe84e0322da429..b15e35baf0f656863352d7ce5e8cf9c9002f1300 100755 (executable)
@@ -5,7 +5,7 @@
 [ "$1" = "-n" ] && {
        shift
        last=$(tail -n1 $SHA1_FILE | cut -f1 -d$'\t')
-       start_from=$(awk -F '\t' '$3 == "'$last'" { getline; print $3; exit 0; }' $CTRL_FILE)
+       start_from=$(awk -F '\t' '$3 == "'$last'" { do getline; while (/^#/ || $2 == "branch"); print $3; exit 0; }' $CTRL_FILE)
 }
 
 [ "$1" = "-s" ] && {