From: Jeff King <peff@peff.net>
To: "krzf83@gmail.com " <krzf83@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: hooks scripts and noexec partition
Date: Wed, 15 Jan 2014 04:16:09 -0500 [thread overview]
Message-ID: <20140115091609.GC14335@sigill.intra.peff.net> (raw)
In-Reply-To: <CAJ1PRS=96aSp3GE+wj=zHX=JGfZbjUeiUuiDDvfJNuRhrbK_Yg@mail.gmail.com>
On Tue, Jan 14, 2014 at 04:41:03PM +0100, krzf83@gmail.com wrote:
> git can't execute hooks no partitions mounted with noexec - even if
> those are just scripts with shebang line
Right. Git does not know that they are shell (or other) scripts; they
could be anything, and the advertised interface is that git will run
exec on them (and it is explicitly OK for them to exist but not be
executable, and git takes this as a sign that they are inactive).
> and they actualy work by
> hooks/./post-comit (because I use small patch on kernel that allows
> running scripts that way on noexec partition)
If you are suggesting that git always execute them as "hooks/./$hook",
that might make sense if such behavior is widespread. But it sounds like
you are running a custom kernel patch to get around the noexec setting.
Here is the custom git patch to match it. :)
diff --git a/run-command.c b/run-command.c
index 3914d9c..ae84e87 100644
--- a/run-command.c
+++ b/run-command.c
@@ -753,7 +753,7 @@ int finish_async(struct async *async)
char *find_hook(const char *name)
{
- char *path = git_path("hooks/%s", name);
+ char *path = git_path("hooks/./%s", name);
if (access(path, X_OK) < 0)
path = NULL;
-Peff
next prev parent reply other threads:[~2014-01-15 9:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 15:41 hooks scripts and noexec partition krzf83@gmail.com
2014-01-15 9:16 ` Jeff King [this message]
2014-12-14 1:44 ` krzf83@gmail.com
2014-12-17 3:03 ` Jeff King
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=20140115091609.GC14335@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=krzf83@gmail.com \
/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).