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

Re: multiple files for the same hook

From
Jeff King <peff@peff.net>
Date
May 13, 2008, 04:21 UTC
Message-ID
<20080513042118.GB4079@sigill.intra.peff.net>
In-Reply-To
<200805122156.30896.hto@arcor.de>
On Mon, May 12, 2008 at 09:56:30PM +0000, Thomas Hunger wrote:
Show 6 quoted lines
> > 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
Previous: Thomas HungerNext: Martin Langhoff
Message 5 of 6 in “multiple files for the same hook”
  1. Thomas HungerMay 12, 2008
  2. Sverre RabbelierMay 12, 2008
  3. Miklos VajnaMay 12, 2008
  4. Thomas HungerMay 12, 2008
  5. Jeff KingMay 13, 2008
  6. Martin LanghoffMay 13, 2008

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.