]> git.ipfire.org Git - thirdparty/git.git/blame - pushall
What's cooking (2024/05 #02)
[thirdparty/git.git] / pushall
CommitLineData
bb94632d
JH
1#!/bin/sh
2
a72c493c 3#sites='ko repo github2 sfjp sf.net'
5e3eaf38 4
6bdb9705 5: ${sites:="github2 ko repo"}
5e3eaf38
JH
6: ${nexts:="$sites"}
7: ${mirrors="github gob-private"}
f93a65c6 8
cf7ee947
JH
9push_retry () {
10 sites=$1
11 shift
12 while :
f93a65c6 13 do
cf7ee947
JH
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"
f93a65c6 30 done
cf7ee947
JH
31}
32
33case " $* " in
c5308116 34*' +next '* | *' next '*)
cf7ee947
JH
35 push_retry "$nexts" "$@"
36 exit $?
37 ;;
38esac
f93a65c6 39
cf7ee947 40push_retry "$sites" "$@"
a9718957 41
80a572b7
JH
42case "$#,$*" in
430,* | 1,-n)
36c4696f
JH
44 for mirror in $mirrors
45 do
46 printf "$mirror mirror: "
47 git push $mirror "$@" || exit $?
48 done
3646cd6e
JH
49 for topic in htmldocs manpages
50 do
51 printf "%s: " "$topic"
80a572b7 52 ( cd ../git-$topic.git && git push "$@") || exit
3646cd6e 53 done
eb94c587 54 test "$1" = '-n' || ( cd ../git-htmldocs.git && git push gh-pages )
3646cd6e 55 ;;
a9718957 56esac