* multiple files for the same hook
@ 2008-05-12 20:39 Thomas Hunger
2008-05-12 20:43 ` Sverre Rabbelier
2008-05-12 20:44 ` Miklos Vajna
0 siblings, 2 replies; 6+ messages in thread
From: Thomas Hunger @ 2008-05-12 20:39 UTC (permalink / raw)
To: git
Hi,
we use hooks a lot for various cleanup tasks, tests and warnings. It
would be wonderful if we could keep the hook logic in separate files.
Something like
hooks/post-commit.d/
where all executable files in the dir are executed in alphanumeric
order. Is there a possibility of this going into git (I could try a
patch)?
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: multiple files for the same hook
2008-05-12 20:39 multiple files for the same hook Thomas Hunger
@ 2008-05-12 20:43 ` Sverre Rabbelier
2008-05-12 20:44 ` Miklos Vajna
1 sibling, 0 replies; 6+ messages in thread
From: Sverre Rabbelier @ 2008-05-12 20:43 UTC (permalink / raw)
To: hto; +Cc: git
On Mon, May 12, 2008 at 10:39 PM, Thomas Hunger <hto@arcor.de> wrote:
> where all executable files in the dir are executed in alphanumeric
> order. Is there a possibility of this going into git (I could try a
> patch)?
Heya,
Wouldn't it be easy to have the hook script do that?
Just have it walk through the directory and call all the scripts?
--
Cheers,
Sverre Rabbelier
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multiple files for the same hook
2008-05-12 20:39 multiple files for the same hook Thomas Hunger
2008-05-12 20:43 ` Sverre Rabbelier
@ 2008-05-12 20:44 ` Miklos Vajna
2008-05-12 21:56 ` Thomas Hunger
1 sibling, 1 reply; 6+ messages in thread
From: Miklos Vajna @ 2008-05-12 20:44 UTC (permalink / raw)
To: Thomas Hunger; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 644 bytes --]
On Mon, May 12, 2008 at 08:39:49PM +0000, Thomas Hunger <hto@arcor.de> wrote:
> we use hooks a lot for various cleanup tasks, tests and warnings. It
> would be wonderful if we could keep the hook logic in separate files.
>
> Something like
>
> hooks/post-commit.d/
>
> where all executable files in the dir are executed in alphanumeric
> order. Is there a possibility of this going into git (I could try a
> patch)?
why would you want so? just create a script named hooks/post-commit,
like:
----
#!/bin/sh
/path/to/first/script
/path/to/second/script
----
or so.
it's not something git should do for you.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multiple files for the same hook
2008-05-12 20:44 ` Miklos Vajna
@ 2008-05-12 21:56 ` Thomas Hunger
2008-05-13 4:21 ` Jeff King
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Hunger @ 2008-05-12 21:56 UTC (permalink / raw)
To: git
Miklos, Sverre,
> why would you want so? just create a script named
> hooks/post-commit, like:
you are right, it's what we actually do, using --template to set up
our own scripts. If nobody but us needs this it's certainly not worth
bothering.
Thanks
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multiple files for the same hook
2008-05-12 21:56 ` Thomas Hunger
@ 2008-05-13 4:21 ` Jeff King
2008-05-13 8:05 ` Martin Langhoff
0 siblings, 1 reply; 6+ messages in thread
From: Jeff King @ 2008-05-13 4:21 UTC (permalink / raw)
To: Thomas Hunger; +Cc: git
On Mon, May 12, 2008 at 09:56:30PM +0000, Thomas Hunger wrote:
> > why would you want so? just create a script named
> > hooks/post-commit, like:
>
> you are right, it's what we actually do, using --template to set up
> our own scripts. If nobody but us needs this it's certainly not worth
> bothering.
The problem is that the semantics of calling some of the hooks is not as
simple as just calling them all in a row. How do you split up the input
going to the hooks? How do you combine the output coming from the hooks?
What is the resulting exit code? If one hook fails, do we indicate
failure? Or if one hook succeeds, do we indicate success?
So before any such code could go into git proper, there would have to be
agreement on how those issues are resolved. In the meantime, it probably
makes more sense to implement a "master" post-commit hook that uses the
semantics that you find useful.
-Peff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: multiple files for the same hook
2008-05-13 4:21 ` Jeff King
@ 2008-05-13 8:05 ` Martin Langhoff
0 siblings, 0 replies; 6+ messages in thread
From: Martin Langhoff @ 2008-05-13 8:05 UTC (permalink / raw)
To: Jeff King; +Cc: Thomas Hunger, git
On Tue, May 13, 2008 at 4:21 PM, Jeff King <peff@peff.net> wrote:
> In the meantime, it probably
> makes more sense to implement a "master" post-commit hook that uses the
> semantics that you find useful.
And when you are implementing those semantics, you might be able to
reuse "run-parts" which does roughly what you want.
:-)
cheers,
m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-05-13 8:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 20:39 multiple files for the same hook Thomas Hunger
2008-05-12 20:43 ` Sverre Rabbelier
2008-05-12 20:44 ` Miklos Vajna
2008-05-12 21:56 ` Thomas Hunger
2008-05-13 4:21 ` Jeff King
2008-05-13 8:05 ` Martin Langhoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox