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

Re: Is there any way to make hooks part of the repository?

From
Johan Herland <johan@herland.net>
Date
May 4, 2012, 06:10 UTC
Message-ID
<CALKQrgcTtjQtS34EZhay8nMKxFO2iCHv+YCZjXefB6oZsa93kw@mail.gmail.com>
In-Reply-To
<CAE1pOi39i4hg_bTuigq15ifuKtXVW7F-NukMP57E_4e=s0fMdQ@mail.gmail.com>
On Thu, May 3, 2012 at 7:05 PM, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:
Show 7 quoted lines
> On 3 May 2012 02:00, Thomas Rast <trast@student.ethz.ch> wrote:
>> Shouldn't those checks be made server-side with a pre-receive hook?
>
> Firstly, see my original email: we have no such access to the server.
> Secondly, (now that I've thought about it a bit more), it makes more
> sense to do it on the "client" instead of having the server do all the
> work for everybody. (Fail early, fail fast.)

No matter how you go about this, there is no way to _guarantee_ that a given hook is run in all user repos (after all, the users have the ultimate control over their own repos), so if you really _need_ the hook to be run, then you have no other choice but to put it on the server. Such is the nature of distributed version control.

If you still want a hook to run in user repos, you can only ask that users enable the hook by including a script which copies the hook into place, and then tell your users to run that script (e.g. in your README).

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Hilco Wijbenga
Message 18 of 18 in “Is there any way to make hooks part of the repository?”
  1. Hilco WijbengaMay 1, 2012
  2. Junio C HamanoMay 1, 2012
  3. Randal L. SchwartzMay 1, 2012
  4. Junio C HamanoMay 1, 2012
  5. Hilco WijbengaMay 1, 2012
  6. PJ WeisbergMay 1, 2012
  7. Hilco WijbengaMay 1, 2012
  8. Nathan GrayMay 2, 2012
  9. Hilco WijbengaMay 2, 2012
  10. Hilco WijbengaMay 1, 2012
  11. Hilco WijbengaMay 1, 2012
  12. Matthieu MoyMay 2, 2012
  13. Hilco WijbengaMay 2, 2012
  14. Junio C HamanoMay 2, 2012
  15. Hilco WijbengaMay 2, 2012
  16. Thomas RastMay 3, 2012
  17. Hilco WijbengaMay 3, 2012
  18. Johan HerlandMay 4, 2012

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.