git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Collins <bricollins@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, s-beyer@gmx.net
Subject: Re: [PATCH v2] Run global hooks from the directory at hooks.dir
Date: Mon, 8 Nov 2010 19:22:43 -0800	[thread overview]
Message-ID: <AANLkTimx5V7P4yFY0HYP6TNOKa+9fZ1vQUkhoMVL7OeR@mail.gmail.com> (raw)
In-Reply-To: <7v39rbpn1c.fsf@alter.siamese.dyndns.org>

> It is left unspecified what happens when the global hook exists and it
> succeeds.  Watch out for hooks that read from their standard input.

The local hook will execute. They are chained.

> In any case, the above is totally backwards from the usual practice and
> expectation of local things overriding the global default.  If you want a
> site-wide policy suggestion, default templates would be a more acceptable
> way (and the implementation of hooks you install to developer repositories
> can choose to look at $GIT_DIR/hooks/local-foo-hook).

The global hook doesn't override the local hook, it supplements it. In any
case, a developer can set hooks.dir to be something else in a specific
repository, and it will override the global default.

> By the way, with a distributed scm, anything-wide policy enforcement at
> the level of developer's individual working repositories is a lost cause.
> You are giving freedom to do anything on their own copy of the history to
> the developers; the project-wide policy is to be enforced at the perimeter
> of your authoritative repository of the project.

The developer is in total control, it is a user configuration option.
It is the same
as setting colours for diffs. Just a preference that makes the developer's life
easier by adding some way of automating certain tasks. Say you want to
post to IRC every time you commit, this could do that. Or if you want to set up
a shell script to jump to your most recently used repository. There are lots of
possible applications. I admit "site-wide coding style enforcement" was a bad
example, and I certainly don't plan to use it for that.

      reply	other threads:[~2010-11-09  3:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-08 12:32 [PATCH v2] Run global hooks from the directory at hooks.dir Brian Collins
2010-11-08 13:29 ` Johannes Sixt
     [not found]   ` <AANLkTi=kFuoaV5Ur_a7FJPg_oUs3svOpq=wEVhdpuoai@mail.gmail.com>
2010-11-08 13:59     ` Brian Collins
2010-11-08 17:13       ` Jonathan Nieder
2010-11-08 20:39 ` Junio C Hamano
2010-11-09  3:22   ` Brian Collins [this message]

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=AANLkTimx5V7P4yFY0HYP6TNOKa+9fZ1vQUkhoMVL7OeR@mail.gmail.com \
    --to=bricollins@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=s-beyer@gmx.net \
    /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).