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
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 2, 2012, 06:38 UTC
Message-ID
<vpqfwbjnl4a.fsf@bauges.imag.fr>
In-Reply-To
<CAE1pOi0_ETdSYsuT0Udhbr6rDvmEcuTA157d6aKUosgi7w28jw@mail.gmail.com>
Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
Show 14 quoted lines
> On 1 May 2012 13:33, Junio C Hamano <gitster@pobox.com> wrote:
>> Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
>>
>>> Is there any way to get (some of) the Git hooks to run for everyone
>>> without everyone having to install them separately? If no, is this by
>>> design or simply a feature nobody has asked for (yet)?
>>
>> By design.  Do you want me to include "rm -fr ~hilco" in some hook of
>> git.git repository?
>
> Mmm, well, I might get quite famous if you did... ;-)
>
> But if you wanted to be evil then you could easily find another place
> (the build scripts, the code itself, et cetera).

Yes, but at least, you have the opportunity to examine the other places before they are ran. Hooks would be really, really nasty security-wise. For example, "git clone" does a checkout, so should probably run the checkout hooks.

> So I don't think this is a good argument. Moreover, I do not work with
> people that would ever consider such nastiness. You need to realize
> that this is all closed source. Your argument would be more valid in
> an open source environment (like git.git).

That may be acceptable for you, but you can't ask for such feature to be included in Git itself. At best, a standardized way to setup hooks (but something that would require a user-action to be set up) would be acceptable.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Hilco WijbengaNext: Hilco Wijbenga
Message 12 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.