3 # Keep lastactivity and personal mob (if enabled) up-to-date
4 # We use receive.updateserverinfo=true so no need to run update-server-info
5 # Send notification through the taskd socket if it exists and not personal mob push
7 # Beware, we MAY be running in a chroot!
13 git config gitweb.lastchange
"$(date '+%a, %d %b %Y %T %z')" ||
:
14 git for-each-ref
--sort=-committerdate --format='%(committerdate:iso8601)' \
15 --count=1 refs
/heads
> info
/lastactivity ||
:
16 ! [ -d htmlcache
] ||
{ >htmlcache
/changed
; } 2>/dev
/null ||
:
17 if [ "$mob" = "mob" -a -d mob
]; then
18 git for-each-ref
--format='%(objectname) %(refname)' > packed-refs.mob.$$ ||
:
19 mv -f packed-refs.mob.$$ packed-refs.mob
20 rm -f packed-refs.mob.$$
23 sockpath
=/etc
/taskd.socket
24 reporoot
=/@jailreporoot@
27 if [ -x /usr
/bin
/perl
]; then
31 sockpath
="$cfg_chroot$sockpath"
32 reporoot
="$cfg_reporoot"
34 # authuser needs to be set if not running in the chroot.
35 # Currently that can only be the case with https push in
36 # which case REMOTE_USER will contain the user name (possibly prefixed
37 # with "/UID=" and suffixed with "/dnQualifier=...").
38 # Fallback is the mirror_user if REMOTE_USER is not set.
39 authuser
="${REMOTE_USER#/UID=}"
40 authuser
="${authuser%/dnQualifier=*}"
41 [ -n authuser
] || authuser
="$cfg_mirror_user"
44 nc_openbsd
() { /bin
/nc.openbsd
"$@"; }
46 projname
="${cwd#$reporoot/}"
48 if [ -n "$GIROCCO_PERSONAL_MOB" ] ||
! [ -S "$sockpath" ]; then
49 # We never run the ref update notification part on a personal mob push
50 # Read the incoming refs, but just ignore them (git doesn't like SIGPIPE)
51 while read -r line
; do
55 while read -r line
; do
56 echo "ref-change $authuser ${projname%.git} $line" | nc_openbsd
-w 1 -U "$sockpath" ||
: