From: Johannes Sixt <j.sixt@viscovery.net>
To: Brian Collins <bricollins@gmail.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, 08 Nov 2010 14:29:27 +0100 [thread overview]
Message-ID: <4CD7FB37.4050107@viscovery.net> (raw)
In-Reply-To: <1289219520-37435-1-git-send-email-bricollins@gmail.com>
Am 11/8/2010 13:32, schrieb Brian Collins:
> Run global hooks in the directory specified by the config variable
> hooks.dir before every attempt at running a local hook. If the
> global hook fails, the local hook will not run. If the global hook is
> absent, the local hook runs normally. This is useful because it means
> you can have scripts that run as hooks for multiple repositories, for
> example coding style enforcement for an entire organization, or
> system-wide commit analytics.
>
> Signed-off-by: Brian Collins <bricollins@gmail.com>
> ---
>
> The possibility of adding this feature was previously discussed here:
> http://marc.info/?l=git&m=127808782807807&w=2
I'm not in favor of this change, as a number of alternatives were
suggested in the thread you cite (Gmane:
http://thread.gmane.org/gmane.comp.version-control.git/150141).
A few hints, just in case you deploy this code:
> + if ((global_path == NULL || access(global_path, X_OK) > 0) &&
> + access(local_path, X_OK) > 0)
> + return 0;
access(2) returns zero on success, negative on failure.
> + if (global_path != NULL)
> + ret = run_hook_file(global_path, index_file, argv) ||
> + run_hook_file(local_path, index_file, argv);
What is the value of ret if the hook in global_path fails? Is it the exit
code, or is it 1? What should it be?
-- Hannes
next prev parent reply other threads:[~2010-11-08 13:29 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 [this message]
[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
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=4CD7FB37.4050107@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=bricollins@gmail.com \
--cc=git@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.