Subject: Re: What about allowing multiple hooks?

From: Anders Waldenborg <[email-masked]>
Date: Thu, 22 Jan 2009 10:57:02 +0100

Johannes Schindelin wrote:
>> So, the thing I initially wanted to solve was "multiple instances" of 
>> the same hook.
> 
> And why not use a shell function for that?
> 
> -- snip --
> buildbot () {
> 	echo "Who is so evil and puts a bot into a post-receive hook?" >&2
> 	echo "This function would connect to $* if it were building a bot."
> }
> 
> buildbot www.google.com
> buildbot www.kernel.org
> -- snap --

That is basically what I started with except that it looked like this:

-- 8< --
#!/bin/sh
/opt/git-triggers/buildbot-sendchange.py 192.168.9.99:9989
/opt/git-triggers/buildbot-sendchange.py 192.168.9.99:9988
/opt/git-triggers/send-mail
/opt/git-triggers/irc-notification
-- 8< --

At that point it thought "hey this looks like a configuration file, 
shouldn't a repository's config live in $GIT_DIR/config?".

We will continue use this config based approach on our site[*] until git 
has something better. For us it wins over shellscript-as-configuration 
for two reasons: 1) git config is easier to script  2) it allows us to 
define site wide triggers in /etc/gitconfig

[*] (our site is medium sized I guess, ~100 repos when all are converted 
to git)

  anders