Staging
v0.5.1
swh:1:snp:c5feb7ee9221a3820c8879e85e8a18470c0b3afa
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
pushall
#!/bin/sh

#sites='ko repo github2 sfjp sf.net'
sites='ko repo github2'
nexts='ko repo github2 '
mirrors='github gob-private'

push_retry () {
	sites=$1
	shift
	while :
	do
		failed=
		for remote in $sites
		do
			printf "%s: " "$remote"
			git push --follow-tags "$remote" "$@" || failed="$failed$remote "
		done

		if test -z "$failed"
		then
			break
		elif test "x$sites" = "x$failed"
		then
			echo >&2 "Failed to push to: $sites"
			exit 1
		fi
		sites="$failed"
	done
}

case " $* " in
*' +next '* | *' next '*)
	push_retry "$nexts" "$@"
	exit $?
	;;
esac

push_retry "$sites" "$@"

case "$#,$*" in
0,* | 1,-n)
	for mirror in $mirrors
	do
		printf "$mirror mirror: "
		git push $mirror "$@" || exit $?
	done
	for topic in htmldocs manpages
	do
		printf "%s: " "$topic"
		( cd ../git-$topic.git && git push "$@") || exit
	done
	test "$1" = '-n' || ( cd ../git-htmldocs.git && git push gh-pages )
	;;
esac
back to top