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

Re: [RFC PATCH] hooks: add some defaults to support sane workflow to pre-commit

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 21, 2009, 11:16 UTC
Message-ID
<200902211216.43964.trast@student.ethz.ch>
In-Reply-To
<499FDDC2.90502@hvoigt.net>
Heiko Voigt wrote:
Show 5 quoted lines
> This leads me to a completely different solution to the same problem.
> How about teaching git to inherit its hooks from the parental project
> (e.g. the one it was cloned from)? That way we are not limited to
> one default behaviour but many that would match the one from the
> upstream project.
[...]
> What do you think about that?
Three words: huge security hole.

Especially on cloning, where the checkout immediately afterwards would already run the post-checkout hook, without any chance for the user to inspect its contents.

The usual advice is to track the hooks in the repository, e.g., under hooks/, and instruct the users to copy them to .git/hooks/ if they want them.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Heiko VoigtNext: Heiko Voigt
Message 4 of 10 in “hooks: add some defaults to support sane workflow to pre-commit”
  1. hooks: add some defaults to support sane workflow to pre-commitHeiko Voigt, Feb 20, 2009
  2. Wincent ColaiutaFeb 20, 2009
  3. Heiko VoigtFeb 21, 2009
  4. Thomas RastFeb 21, 2009
  5. Heiko VoigtFeb 21, 2009
  6. Jakub NarebskiFeb 21, 2009
  7. Heiko VoigtFeb 21, 2009
  8. Heiko VoigtFeb 23, 2009
  9. Junio C HamanoOct 19, 2009
  10. Heiko VoigtOct 20, 2009

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.