git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What about allowing multiple hooks?

From
Anders Waldenborg <anders@0x63.nu>
Date
Jan 22, 2009, 09:57 UTC
Message-ID
<497842EE.8000400@0x63.nu>
In-Reply-To
<alpine.DEB.1.00.0901212247510.3586@pacific.mpi-cbg.de>
Johannes Schindelin wrote:
Show 14 quoted lines
>> 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
Previous: Johannes Schindelin
Message 10 of 10 in “What about allowing multiple hooks?”
  1. Marc WeberNov 21, 2008
  2. martin f krafftNov 21, 2008
  3. Rogan DawesNov 21, 2008
  4. Alexander PotashevJan 3, 2009
  5. Junio C HamanoJan 4, 2009
  6. Anders WaldenborgJan 21, 2009
  7. Johannes SchindelinJan 21, 2009
  8. Anders WaldenborgJan 21, 2009
  9. Johannes SchindelinJan 21, 2009
  10. Anders WaldenborgJan 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.