From: Johan Herland Date: Thu, 20 Mar 2008 11:20:47 GMT Subject: Re: global hooks Message-ID: <200803201220.47503.johan@herland.net> In-Reply-To: <7vk5jyyvw1.fsf@gitster.siamese.dyndns.org> On Thursday 20 March 2008, Junio C Hamano wrote: > Victor Bogado da Silva Lins writes: > > > SO my question is, is there a way to make that hook global to all > > projects? If not, would it be a good idea to allow this? > > Probably a post- git-init hook that lets you do anything to your newly > created repository would be the only thing that you need. Then you can > copy, untar or even use symlink to muck with .git/hooks/ in whatever way > you please. > > There needs a mechanism for you to specify what that hook is, and it > cannot be in individual repositories, so it has to live in ~/.gitconfig > somewhere. Or you could add the hook (either the post-init hook, or for that matter the hook you want to make global) to the Git template directory on your system (/usr/share/git-core/templates by default). If you don't want to make it system-global (only user-global), I guess you could make your own Git template directory somewhere (copy the system's template dir, and add/enable whatever hooks you like), and set up an alias to "git init --template=". Then use this alias instead of "git init". ...Johan -- Johan Herland, www.herland.net