Meta/KO: allow checking against mirror sites other than k.org
[git] / KO
1 #!/bin/sh
2 #
3 # Not for general consumption; a script I used to make sure
4 # I do not accidentally push a rewound master to public.
5
6 no_fetch= ko=ko
7 while :
8 do
9         case "$#,$1" in
10         0,*) break ;;
11         *,--no-fetch) no_fetch=t; shift ;;
12         *,--*) echo >&2 "unknown option $1"; exit 1 ;;
13         *) ko=$1; shift ;;
14         esac
15 done
16
17 if test -z "$no_fetch"
18 then
19         git fetch "$ko"
20 fi
21
22 mb=$(git merge-base $ko/master master)
23 h=$(git rev-parse $mb $ko/master | sort -u | wc -l)
24 if test "$h" != 1
25 then
26         echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward."
27         exit 1
28 fi
29 git show-branch --topo-order $ko/master master
30 git show-branch --topo-order $ko/maint maint
31 git show-branch --topo-order $ko/next next
32 git show-branch --topo-order $ko/pu pu