From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Thomas Adam <thomas.adam22@gmail.com>
Cc: git mailing list <git@vger.kernel.org>
Subject: Re: Adding custom hooks to a bare repository.
Date: Mon, 28 Jul 2008 14:40:19 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.1.00.0807281438220.2725@eeepc-johanness> (raw)
In-Reply-To: <18071eea0807280532l69d12e3ehb8377da9d24e035@mail.gmail.com>
Hi,
On Mon, 28 Jul 2008, Thomas Adam wrote:
> 2008/7/28 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
>
> > Yes. Hooks, just as the config and reflogs, are supposed to be local
> > things. Rationale being: it is rude, and also insecure, to install
> > something that potentially calls other programs without the user
> > saying so.
>
> Oh absolutely, I agree with that.
>
> > All you can do is checking in a copy of the hook, and ask your
> > users/check in your build system that it is installed.
>
> Hmm -- perhaps I am being unintentionally dense, but I am assuming
> that when you say "checking in a copy" you mean anywhere other than
> .git/hooks/ since that isn't tracked by git. I have no problem with
> the rationale you've just described -- but it would be handy to add
> this post-merge hook script into hooks/ (exec bit removed) such that
> on a clone, all one would need to do is chmod +x it. If that's
> possible, I'm clearly missing the steps to enable this.
No, as you said, anything in .git/ is not meant to be tracked. Besides,
if a user would change the executable bit (as advised), Git would always
show this file as modified, making the tree permanently dirty (or worse,
it could be accidentally be committed as executable).
For all those reasons, it is better to just commit an executable script in
your <toplevel>/githooks/post-merge and ask your users to copy it to
.git/hooks/.
Hth,
Dscho
next prev parent reply other threads:[~2008-07-28 12:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-28 11:04 Adding custom hooks to a bare repository Thomas Adam
2008-07-28 11:26 ` Johannes Schindelin
2008-07-28 12:32 ` Thomas Adam
2008-07-28 12:40 ` Johannes Schindelin [this message]
2008-07-28 12:40 ` Thomas Adam
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=alpine.DEB.1.00.0807281438220.2725@eeepc-johanness \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=thomas.adam22@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