{"thread":{"id":"13497","subject":"multiple files for the same hook","startedAt":"2008-05-12T20:39:49Z","lastAt":"2008-05-13T08:05:44Z","messageCount":6,"participants":["Thomas Hunger","Sverre Rabbelier","Miklos Vajna","Jeff King","Martin Langhoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76787","messageId":"200805122039.49779.hto@arcor.de","threadId":"13497","inReplyTo":null,"subject":"multiple files for the same hook","fromName":"Thomas Hunger","fromEmail":"hto@arcor.de","sentAt":"2008-05-12T20:39:49Z","receivedAt":"2008-05-12T20:39:49Z","isPatch":false,"sender":{"key":"hto@arcor.de","avatar":null},"body":"Hi,\n\nwe use hooks a lot for various cleanup tasks, tests and warnings. It \nwould be wonderful if we could keep the hook logic in separate files. \n\nSomething like\n\n    hooks/post-commit.d/\n\nwhere all executable files in the dir are executed in alphanumeric \norder. Is there a possibility of this going into git (I could try a \npatch)?\n\nTom\n"},{"id":"76789","messageId":"bd6139dc0805121343i71fc99ebr6570044ddc0ba287@mail.gmail.com","threadId":"13497","inReplyTo":"200805122039.49779.hto@arcor.de","subject":"Re: multiple files for the same hook","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-05-12T20:43:31Z","receivedAt":"2008-05-12T20:43:31Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Mon, May 12, 2008 at 10:39 PM, Thomas Hunger <hto@arcor.de> wrote:\n>  where all executable files in the dir are executed in alphanumeric\n>  order. Is there a possibility of this going into git (I could try a\n>  patch)?\n\nHeya,\n\nWouldn't it be easy to have the hook script do that?\nJust have it walk through the directory and call all the scripts?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"76790","messageId":"20080512204445.GT27724@genesis.frugalware.org","threadId":"13497","inReplyTo":"200805122039.49779.hto@arcor.de","subject":"Re: multiple files for the same hook","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-05-12T20:44:45Z","receivedAt":"2008-05-12T20:44:45Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Mon, May 12, 2008 at 08:39:49PM +0000, Thomas Hunger <hto@arcor.de> wrote:\n> we use hooks a lot for various cleanup tasks, tests and warnings. It \n> would be wonderful if we could keep the hook logic in separate files. \n> \n> Something like\n> \n>     hooks/post-commit.d/\n> \n> where all executable files in the dir are executed in alphanumeric \n> order. Is there a possibility of this going into git (I could try a \n> patch)?\n\nwhy would you want so? just create a script named hooks/post-commit,\nlike:\n\n----\n#!/bin/sh\n/path/to/first/script\n/path/to/second/script\n----\n\nor so.\n\nit's not something git should do for you.\n"},{"id":"76799","messageId":"200805122156.30896.hto@arcor.de","threadId":"13497","inReplyTo":"20080512204445.GT27724@genesis.frugalware.org","subject":"Re: multiple files for the same hook","fromName":"Thomas Hunger","fromEmail":"hto@arcor.de","sentAt":"2008-05-12T21:56:30Z","receivedAt":"2008-05-12T21:56:30Z","isPatch":false,"sender":{"key":"hto@arcor.de","avatar":null},"body":"Miklos, Sverre,\n\n> why would you want so? just create a script named\n> hooks/post-commit, like:\n\nyou are right, it's what we actually do, using --template to set up \nour own scripts. If nobody but us needs this it's certainly not worth \nbothering.\n\nThanks\nTom\n"},{"id":"76828","messageId":"20080513042118.GB4079@sigill.intra.peff.net","threadId":"13497","inReplyTo":"200805122156.30896.hto@arcor.de","subject":"Re: multiple files for the same hook","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-05-13T04:21:18Z","receivedAt":"2008-05-13T04:21:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 12, 2008 at 09:56:30PM +0000, Thomas Hunger wrote:\n\n> > why would you want so? just create a script named\n> > hooks/post-commit, like:\n> \n> you are right, it's what we actually do, using --template to set up \n> our own scripts. If nobody but us needs this it's certainly not worth \n> bothering.\n\nThe problem is that the semantics of calling some of the hooks is not as\nsimple as just calling them all in a row. How do you split up the input\ngoing to the hooks? How do you combine the output coming from the hooks?\nWhat is the resulting exit code? If one hook fails, do we indicate\nfailure? Or if one hook succeeds, do we indicate success?\n\nSo before any such code could go into git proper, there would have to be\nagreement on how those issues are resolved. In the meantime, it probably\nmakes more sense to implement a \"master\" post-commit hook that uses the\nsemantics that you find useful.\n\n-Peff\n"},{"id":"76841","messageId":"46a038f90805130105p67fa2081p2537db29305a6231@mail.gmail.com","threadId":"13497","inReplyTo":"20080513042118.GB4079@sigill.intra.peff.net","subject":"Re: multiple files for the same hook","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2008-05-13T08:05:44Z","receivedAt":"2008-05-13T08:05:44Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Tue, May 13, 2008 at 4:21 PM, Jeff King <peff@peff.net> wrote:\n>  In the meantime, it probably\n>  makes more sense to implement a \"master\" post-commit hook that uses the\n>  semantics that you find useful.\n\nAnd when you are implementing those semantics, you might be able to\nreuse \"run-parts\" which does roughly what you want.\n\n:-)\n\ncheers,\n\n\n\nm\n--\n martin.langhoff@gmail.com\n martin@laptop.org -- School Server Architect\n - ask interesting questions\n - don't get distracted with shiny stuff - working code first\n - http://wiki.laptop.org/go/User:Martinlanghoff\n"}]}