What's cooking (2011/11 #1)
[alt-git.git] / CheckPush
blob0f0ae5916ef167ff0d9935a2d4d083c8b1e1a52b
1 #!/bin/sh
3 for range in $(
4 prev_branch=
6 git for-each-ref --format='%(refname)' refs/heads/maint-* |
7 sed -e 's|^refs/heads/||'
8 cat <<-EOF
9 maint
10 master
11 next
12 EOF
13 } |
14 while read branch
16 if test -n "$prev_branch"
17 then
18 echo "$branch..$prev_branch"
20 prev_branch=$branch
21 done
22 ) pu..jch
24 lg=$(git log --oneline "$range")
25 if test -n "$lg"
26 then
27 echo "*** $range ***"
28 echo "$lg"
30 done
32 if next_tree=$(git rev-parse next^{tree}) &&
33 next_equiv=$(git rev-list jch..pu |
34 xargs -n1 sh -c '
35 echo $(git rev-parse $1^{tree}) $1
36 ' - | sed -n -e "s/^$next_tree //p"
37 ) &&
38 test -n "$next_equiv"
39 then
40 jch=$(git rev-list --first-parent master..jch | wc -l) &&
41 pu=$(git rev-list --first-parent master..pu | wc -l) &&
42 next=$(git rev-list --first-parent master..$next_equiv | wc -l) &&
43 echo $jch..$next..$pu
44 else
45 git diff --stat next jch