List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH] contrib/hooks: add sample post-receive hook using agefile
Date: Tue, 23 Dec 2014 15:48:28 +0000	[thread overview]
Message-ID: <20141223154828.GB9188@serenity.lan> (raw)
In-Reply-To: <54998703.5090901@hupie.com>

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"


  reply	other threads:[~2014-12-23 15:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 14:40 john
2014-12-23 15:15 ` mailings
2014-12-23 15:48   ` john [this message]
2014-12-23 16:12     ` mailings
2015-08-12 10:54       ` john
2015-08-12 12:05         ` Jason
2015-08-12 12:06 ` Jason
2015-08-12 13:41   ` Jason
2015-08-12 15:04     ` john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141223154828.GB9188@serenity.lan \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).