]>
git.wh0rd.org - home.git/blob - .bin/r
9 acmd
=$
(git config
--get "alias.${cmd}")
13 case ${acmd:-${cmd}} in
15 if [[ $1 == "all" ]] ; then
17 if [[ $# -eq 0 ]] ; then
18 exec r forall
-c 'r rb all .'
21 branches
=$
(g b |
awk '
23 if ($0 ~ "^[*] *[(]no branch[)]") {
25 } else if ($1 == "*") {
31 END { print list b }')
32 [[ -z ${branches} ]] && exit 0
34 eval $
(bash-colors
--env)
35 echo "${GOOD}### ${PWD}${NORMAL}"
36 for b
in ${branches} ; do
37 echo " ${HILITE}### $b${NORMAL}"
50 while [[ ! -d ${root}/.repo
&& ${root} != "/" ]] ; do
53 cd "${root}" ||
exit 1
55 if [[ ! -e .repo
/sandbox-url
]] ; then
56 echo "Please configure remote url base in ${root}/.repo/sandbox-url"
59 remote
=$
(<.repo
/sandbox-url
) ||
exit 1
61 echo "pushing projects from ${root}"
65 tcnt
=$
(echo "${rlist}" |
wc -l)
70 export GIT_DIR
=${path}/.git
72 printf '### (%*i/%i %3i%%) %s\n' \
73 ${#tcnt} $((cnt++)) ${tcnt} $(( cnt * 100 / tcnt )) ${proj}
75 g l
-1 ${src} >& /dev
/null || src
=
76 ( g push
--force ${remote}/${proj} ${src}:refs/sandbox/${USER}/${sync_branch} >/dev
/null
) &
78 # ssh servers do not like it when you hammer them :)
79 # Received disconnect from 74.125.248.80: 7: Too many concurrent connections
80 # fatal: The remote end hung up unexpectedly
82 if [[ ${#pids[@]} -eq 20 ]] ; then
93 exec repo
${acmd:-${cmd}} "$@"