]> git.ozlabs.org Git - next-scripts/blob - check_left
update to_build_host a bit
[next-scripts] / check_left
1 #!/bin/bash
2
3 LOG_FILE="../left_over.log"
4
5 cp /dev/null "$LOG_FILE"
6
7 heads=$(awk -F '\t' '/^#/ {next;} $2=="branch" {next;} { printf("%s/%s ", $3, $5); }' ../etc/control)
8 prev_heads=""
9
10 total=0
11
12 for h in $heads; do
13         base=origin/master
14         case "$h" in
15         akpm/*)
16                 base=akpm/master-base
17                 ;;
18         esac
19 #       echo "$h"
20 #       mb=$(git merge-base origin/master "$h")
21 #       rh=$(git rev-parse "$h")
22 #       [ "$mb" = "$rh" ] &&
23 #               continue
24
25 #       c=$(git rev-list --pretty='format:%m%H' --no-merges --left-right --cherry-pick origin/master..."$h" | sed -n 's/^>//p')
26 #       c=$(git rev-list --no-merges origin/master.."$h")
27 #       [ -z "$c" ] &&
28 #               continue
29         count=$(git rev-list --count --no-merges $prev_heads  "$base".."$h")
30         [ "$count" == 0 ] &&
31                 continue
32
33         total=$(( $total + $count ))
34         echo | tee -a "$LOG_FILE"
35         echo "${h%%/*}" "$count" | tee -a "$LOG_FILE"
36         echo | tee -a "$LOG_FILE"
37 #       git shortlog --no-walk "$c" 2>&1 | tee -a "$LOG_FILE"
38         git log --oneline --no-merges $prev_heads "$base".."$h" | tee -a "$LOG_FILE"
39
40 #       gitk stable..$h
41         prev_heads="$prev_heads ^$h"
42 done
43
44 echo | tee -a "$LOG_FILE"
45 echo "Total $total"
46
47 exit 0