8 cd "$cfg_reporoot/$proj.git"
10 if check_interval lastrefresh
$cfg_min_mirror_interval; then
11 progress
"= [$proj] update skip (last at $(config_get lastrefresh))"
14 progress
"+ [$proj] update (`date`)"
20 url
="$(config_get baseurl)"
21 mail="$(config_get owner)"
23 bang git for-each-ref
--format '%(refname) %(objectname)' >.refs-before
27 GIT_DIR
=. bang git svn fetch
28 GIT_DIR
=. bang git fetch
31 bang git remote update
32 bang git remote prune origin
36 bang git update-server-info
37 bang config_set lastrefresh
"$(date -R)"
39 # Look at which refs changed and trigger ref-change for these
40 bang git for-each-ref
--format '%(refname) %(objectname)' >.refs-after
41 sockpath
="$cfg_chroot/etc/taskd.socket"
42 if [ -S "$sockpath" ] && ! cmp -s .refs-before .refs-after
; then
44 join -j 1 .refs-before .refs-after |
45 while read ref old new
; do
46 [ "$old" != "$new" ] ||
continue
47 echo "ref-change -1 $proj $old $new $ref"
49 join -j 1 -v 1 .refs-before .refs-after |
50 while read ref old
; do
51 echo "ref-change -1 $proj $old 0000000000000000000000000000000000000000 $ref"
53 join -j 1 -v 2 .refs-before .refs-after |
54 while read ref new
; do
55 echo "ref-change -1 $proj 0000000000000000000000000000000000000000 $new $ref"
57 } | nc.openbsd
-w 1 -U "$sockpath"
60 rm -f .refs-before .refs-after
62 if [ -e .banged
]; then
63 echo "$proj update succeeded - failure recovery" |
mail -s "[$cfg_name] $proj update succeeded" "$mail,$cfg_admin"
67 progress
"- [$proj] update (`date`)"