What's cooking (2024/04 #05)
[alt-git.git] / pushall
blob8d18760b007998a6037ccc76e7d12a2a1a789fa6
1 #!/bin/sh
3 #sites='ko repo github2 sfjp sf.net'
5 : ${sites:="github2 ko repo"}
6 : ${nexts:="$sites"}
7 : ${mirrors="github gob-private"}
9 push_retry () {
10 sites=$1
11 shift
12 while :
14 failed=
15 for remote in $sites
17 printf "%s: " "$remote"
18 git push --follow-tags "$remote" "$@" || failed="$failed$remote "
19 done
21 if test -z "$failed"
22 then
23 break
24 elif test "x$sites" = "x$failed"
25 then
26 echo >&2 "Failed to push to: $sites"
27 exit 1
29 sites="$failed"
30 done
33 case " $* " in
34 *' +next '* | *' next '*)
35 push_retry "$nexts" "$@"
36 exit $?
38 esac
40 push_retry "$sites" "$@"
42 case "$#,$*" in
43 0,* | 1,-n)
44 for mirror in $mirrors
46 printf "$mirror mirror: "
47 git push $mirror "$@" || exit $?
48 done
49 for topic in htmldocs manpages
51 printf "%s: " "$topic"
52 ( cd ../git-$topic.git && git push "$@") || exit
53 done
54 test "$1" = '-n' || ( cd ../git-htmldocs.git && git push gh-pages )
56 esac