On Tue, Dec 23, 2014 at 04:15:15PM +0100, Ferry Huberts wrote:
> 
> 
> On 23/12/14 15:40, John Keeping wrote:
> > +agefile="$(git rev-parse --git-dir)"/info/web/last-modified
> 
> use $GIT_DIR here instead of rev-parse

githooks(5) doesn't guarantee that GIT_DIR will be set and the fact that
it currently is seems to be an artifact of how old versions of Git work
([0]).

I'd prefer to stick with rev-parse, which is what the example hooks in
git.git use.

[0] http://permalink.gmane.org/gmane.comp.version-control.git/136276

> > +
> > +mkdir -p "$(dirname "$agefile")" &&
> > +git for-each-ref \
> > +   --sort=-authordate --count=1 \
> > +   --format='%(authordate:iso8601)' \
> > +   >"$agefile"
_______________________________________________
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit

Reply via email to