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

Re: Issuing warning when hook does not have execution permission

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 20, 2014, 17:51 UTC
Message-ID
<xmqqzjezt5fq.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140820101921.GA21527@peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> On Wed, Aug 20, 2014 at 08:55:52PM +1200, Chris Packham wrote:
>
>> I actually find the existing behaviour useful. If I want to disable a
>> hook to I can just chmod -x .git/hook/... and I then chmod +x it when
>> I want to re-enable it. I guess I could live with an extra warning as
>> long as the command still succeeds.
>
> You could do the same thing "mv $hook $hook.disabled" but it involves
> retraining your fingers. I kind of agree that the existing system of
> respecting the executable bit is nice, though: it does what you told it
> to do, and a misconfiguration is your problem, not the system's. It's
> perhaps worth changing if people frequently get the executable-bit thing
> wrong, but I don't know whether they do or not.
>
> I kind of feel like we had a similar discussion around items in PATH,
> but I don't remember how it resolved.

I don't either, but IIRC the primary tricky point was what happens when a component of $PATH list is inaccessible, making us unable to even know if an executable we are looking for exists there or not, which is slightly a different issue.

And I also kind of agree that the existing system is nice. It may sound like a good idea to warn when there is even a slight chance of misconfiguration on the user's side, but for this particular one, it has been a designed-in behaviour for a long time, and it may be unwise to change it.

Previous: Jeff King
Message 6 of 6 in “Issuing warning when hook does not have execution permission”
  1. Babak MAug 19, 2014
  2. Jeff KingAug 19, 2014
  3. Junio C HamanoAug 19, 2014
  4. Chris PackhamAug 20, 2014
  5. Jeff KingAug 20, 2014
  6. Junio C HamanoAug 20, 2014

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.