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

hooks are ignored if there are not marked as executable

From
Damien <damien@dam.io>
Date
Oct 2, 2017, 10:06 UTC
Message-ID
<CAAQ5yigO8FxhUjwr68OnW0UEYck2AKF5P0Qt_zedhBL_SEiKTw@mail.gmail.com>
Hi,

If you do `echo my_script > .git/hooks/pre-commit` and then `git commit`, The hook is just gonna be ignored. But if you do `chmod +x .git/hooks/pre-commit`, then it's executed.

I think ignoring a hook is misleading and not newbie friendly, an error message to signal an incorrectly configured hook could be better. At least as a warning to be backward-compatible.

Thanks, Damien

Next: Jonathan Nieder
Message 1 of 2 in “hooks are ignored if there are not marked as executable”
  1. DamienOct 2, 2017
  2. Jonathan NiederOct 2, 2017

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.