CGit and modification times
plenz at cis.fu-berlin.de
Wed May 18 12:19:24 CEST 2011
* Ferry Huberts <mailings at hupie.com> [2011-05-15 12:00]:
> > This obviously is a bit more expensive but maybe also a bit more correct?
> Thought about it a bit more and I think current behaviour (+ the
> packed-refs patch) is good enough.
It is pretty expensive to cover all the corner cases like packed refs.
Also, the file's modification time might not be the time the last
commit was made.
Unless you want to do this expensive look up every time you request a
repository listing (caching aside), your best bet is to write the
commit date to a so-called agefile. You find out the date of the last
commit upon a "git push" (via an update hook) and later retrieve it
(which is a fast operation: simply reading in a small file).
See here for an example command:
Lars: It may be worth starting a FAQ page. What do you think?
More information about the CGit