Re: Make author and committer available to pre-commit hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]