Meta/KO: allow checking against mirror sites other than k.org
Junio C Hamano committed
Sep 28, 2011 at 18:14 UTC
1b5333e7df9273c05615d0043bbbab43ba5c1bba
1 file changed
+22
-8
KO
+22
-8
@@ -3,16 +3,30 @@
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
-case "$1" in --no-fetch) shift ;; *) git fetch ko ;; esac
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
8
-mb=$(git merge-base ko/master master)
9
-h=$(git rev-parse $mb ko/master | sort -u | wc -l)
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
12
- echo "OOOOOPPPPPPPPPPPPPPSSS! master is not ko/master fast forward."
26
+ echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward."
27
exit 1
28
fi
15
-git show-branch --topo-order ko/master master
16
-git show-branch --topo-order ko/maint maint
17
-git show-branch --topo-order ko/next next
18
-git show-branch --topo-order ko/pu pu
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