]> git.ipfire.org Git - thirdparty/git.git/blob - pushall
What's cooking (2024/01 #09)
[thirdparty/git.git] / pushall
1 #!/bin/sh
2
3 #sites='ko repo github2 sfjp sf.net'
4
5 : ${sites:="github2 ko repo"}
6 : ${nexts:="$sites"}
7 : ${mirrors="github gob-private"}
8
9 push_retry () {
10 sites=$1
11 shift
12 while :
13 do
14 failed=
15 for remote in $sites
16 do
17 printf "%s: " "$remote"
18 git push --follow-tags "$remote" "$@" || failed="$failed$remote "
19 done
20
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
28 fi
29 sites="$failed"
30 done
31 }
32
33 case " $* " in
34 *' +next '* | *' next '*)
35 push_retry "$nexts" "$@"
36 exit $?
37 ;;
38 esac
39
40 push_retry "$sites" "$@"
41
42 case "$#,$*" in
43 0,* | 1,-n)
44 for mirror in $mirrors
45 do
46 printf "$mirror mirror: "
47 git push $mirror "$@" || exit $?
48 done
49 for topic in htmldocs manpages
50 do
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 )
55 ;;
56 esac