Cgit v0.9.2 problem with get_repo_modtime

Jason A. Donenfeld Jason at zx2c4.com
Thu Aug 15 19:56:07 CEST 2013


Keep in mind that when agefile is not specified and its default of
"info/web/last-modified" does not exist, then it falls back to using
"refs/heads/$defbranch", and by default $defbranch is "master", so any
git command that affects refs/heads/master will influence the time
stamp.

Using agefile is a good way of making things more specific.

Another way is keeping refs/heads/$blah up to date with something like
one of these scripts after your gc or maintenance operations:

> for i in *.git; do
>         cd "$i"
>         touch -d "$(git log -1 --format=format:'%aD%n' $(cat refs/heads/master))" refs/heads/master
>         cd ..
> done

or

> for i in *.git; do
>         cd "$i"
>         for j in refs/heads/*; do
>                 touch -d "$(git log -1 --format=format:'%aD%n' $(cat $j))" $j
>         done
>         cd ..
> done


This isn't necessarily as good as using an agefile and a post-receive
hook, but it does ensure that those particular filesystem files
metadata contain useful correlations to the git repos.


More information about the CGit mailing list