From: Jeff King <peff@peff.net>
To: Gisle Aas <gisle@aas.no>
Cc: git@vger.kernel.org
Subject: Re: Make author and committer available to pre-commit hook
Date: Mon, 5 Jul 2010 07:46:19 -0400 [thread overview]
Message-ID: <20100705114619.GA21146@sigill.intra.peff.net> (raw)
In-Reply-To: <AANLkTinpCDRf_Yhuj2-tdZwmvHk8yna1Xjdtbrmx35CB@mail.gmail.com>
On Mon, Jul 05, 2010 at 01:30:46PM +0200, Gisle Aas wrote:
> I would like to implement a pre-commit hook that validates the
> --author set for the commit. Our use case is a shared repository of
> configuration info where different persons all commit as root; but we
> want to make sure they override the --author to something sensible.
>
> What would be the preferred mechanism to pass on this information? It
> could for instance be arguments to the hook script or via environment
> variables.
It would make sense to me for it to be passed in through the environment
using GIT_{AUTHOR,COMMITTER}_{NAME,EMAIL}. You could even pass
GIT_AUTHOR_DATE to detect if somebody is using "git commit -c" to get
the date from a previous commit.
-Peff
next prev parent reply other threads:[~2010-07-05 11:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-05 11:30 Make author and committer available to pre-commit hook Gisle Aas
2010-07-05 11:46 ` Jeff King [this message]
2010-07-05 18:04 ` Gisle Aas
2010-07-05 21:31 ` Ævar Arnfjörð Bjarmason
2010-07-06 3:04 ` Junio C Hamano
2010-07-06 7:29 ` Jeff King
2010-07-06 9:22 ` Gisle Aas
2010-07-06 15:47 ` Junio C Hamano
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=20100705114619.GA21146@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=gisle@aas.no \
--cc=git@vger.kernel.org \
/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).