What's cooking (2015/01 #01)
[git.git] / pushall
blob2971364e77be6ce24b62597eac3a86c2caff0d6f
1 #!/bin/sh
3 sites='ko repo github2 sfjp sf.net gph '
4 nexts='ko repo gph github2'
6 push_retry () {
7 sites=$1
8 shift
9 while :
11 failed=
12 for remote in $sites
14 printf "%s: " "$remote"
15 git push --follow-tags "$remote" "$@" || failed="$failed$remote "
16 done
18 if test -z "$failed"
19 then
20 break
21 elif test "x$sites" = "x$failed"
22 then
23 echo >&2 "Failed to push to: $sites"
24 exit 1
26 sites="$failed"
27 done
30 case " $* " in
31 *' +next '*)
32 push_retry "$nexts" "$@"
33 exit $?
35 esac
37 push_retry "$sites" "$@"
39 case "$#,$*" in
40 0,* | 1,-n)
41 printf "github mirror: "
42 git push github "$@" || exit $?
43 for topic in htmldocs manpages
45 printf "%s: " "$topic"
46 ( cd ../git-$topic.git && git push "$@") || exit
47 done
49 esac