Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 181785487ecd48c7a3760ca31a6a245aabb2cbc8 authored by Junio C Hamano on 22 January 2022, 03:05:07 UTC
What's cooking (2022/01 #06)
Tip revision: 1817854
KO
#!/bin/sh
#
# Not for general consumption; a script I used to make sure
# I do not accidentally push a rewound master to public.

MASTER=master

no_fetch= ko=ko
while :
do
	case "$#,$1" in
	0,*) break ;;
	*,--no-fetch) no_fetch=t; shift ;;
	*,--*) echo >&2 "unknown option $1"; exit 1 ;;
	*) ko=$1; shift ;;
	esac
done

if test -z "$no_fetch"
then
	git fetch "$ko"
fi

mb=$(git merge-base $ko/$MASTER $MASTER)
h=$(git rev-parse $mb $ko/$MASTER | sort -u | wc -l)
if test "$h" != 1
then
	echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
	exit 1
fi
git show-branch --topo-order $ko/$MASTER $MASTER
git show-branch --topo-order $ko/maint maint
git show-branch --topo-order $ko/next next
git show-branch --topo-order $ko/seen seen
back to top