What's cooking (2024/04 #09)
[git.git] / KO
blob6e8f05e9d359eef21b7598e84b95432e890c2ca6
1 #!/bin/sh
3 # Not for general consumption; a script I used to make sure
4 # I do not accidentally push a rewound master to public.
6 MASTER=master
8 no_fetch= ko=ko
9 while :
11 case "$#,$1" in
12 0,*) break ;;
13 *,--no-fetch) no_fetch=t; shift ;;
14 *,--*) echo >&2 "unknown option $1"; exit 1 ;;
15 *) ko=$1; shift ;;
16 esac
17 done
19 if test -z "$no_fetch"
20 then
21 git fetch "$ko"
24 mb=$(git merge-base $ko/$MASTER $MASTER)
25 h=$(git rev-parse $mb $ko/$MASTER | sort -u | wc -l)
26 if test "$h" != 1
27 then
28 echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
29 exit 1
31 git show-branch --topo-order $ko/$MASTER $MASTER
32 git show-branch --topo-order $ko/maint maint
33 git show-branch --topo-order $ko/next next
34 git show-branch --topo-order $ko/seen seen