git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien <damien@dam.io>
To: git@vger.kernel.org
Subject: hooks are ignored if there are not marked as executable
Date: Mon, 2 Oct 2017 12:06:09 +0200	[thread overview]
Message-ID: <CAAQ5yigO8FxhUjwr68OnW0UEYck2AKF5P0Qt_zedhBL_SEiKTw@mail.gmail.com> (raw)

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

             reply	other threads:[~2017-10-02 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-02 10:06 Damien [this message]
2017-10-02 22:50 ` hooks are ignored if there are not marked as executable Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAQ5yigO8FxhUjwr68OnW0UEYck2AKF5P0Qt_zedhBL_SEiKTw@mail.gmail.com \
    --to=damien@dam.io \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).