git/pushall
2016-06-09 10:20:59 -07:00

51 lines
819 B
Bash
Executable File

#!/bin/sh
sites='ko repo github2 sfjp sf.net gob-private '
nexts='ko repo github2 '
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 '*)
push_retry "$nexts" "$@"
exit $?
;;
esac
push_retry "$sites" "$@"
case "$#,$*" in
0,* | 1,-n)
printf "github mirror: "
git push github "$@" || exit $?
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