Re: What about allowing multiple hooks?

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

 



Hi,

On Wed, 21 Jan 2009, Anders Waldenborg wrote:

> Johannes Schindelin wrote:
> > > I currently use configvalues to specify which hooks to run. For example
> > > this is how my post-receive looks:
> > >
> > > data=$(cat)
> > > git config --get-all hooks.post-receive.hook | while read hook; do
> > >         $hook <<__EOF__
> > > "$data"
> > > __EOF__
> > > done
> > 
> > I wonder why you don't do the obvious thing:
> 
> 
> Because I wanted to be able to do things like this:
> 
> git config -add hooks.post-receive.hook \
>  "sh hooks/buildbot 192.168.99.9:9989"

You are missing a "-".

> 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 --

> Then when I found this thread I saw that the richer meta information 
> needed to implement multiple hooks with sane semantics could be done 
> with the config values.

I think this is technically called an "XY" problem.  You ask for a 
specific technical solution, while your real problem would be better 
solved by other means.

Ciao,
Dscho

--
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]

  Powered by Linux