list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* RFC: Supporting .git/hooks/$NAME.d/* && /etc/git/hooks/$NAME.d/*
@ 2016-04-22 23:51 Ævar Arnfjörð Bjarmason
  2016-04-25 17:45 ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2016-04-22 23:51 UTC (permalink / raw)
  To: Git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

On Sat, Apr 23, 2016 at 1:33 AM, Ævar Arnfjörð Bjarmason
<> wrote:
> Change the hardcoded lookup for .git/hooks/* to optionally lookup in
> $(git config core.hooksDirectory)/* instead if that config key is set.

I think this'll do for my use-case, but I started with a rather more
ambitious patch that I could forsee not finishing today.

I wanted to support executing e.g. the pre-commit hook, in order, from any of:

     [We could add some ~-wide path here I guess...]

Where the * would be resolved in glob() order.

The motivation was solving the use-case I'm solving with
core.hooksDirectory, perhaps with a config variable to set whether you
wanted to skip per-repo or system-wide hooks, but also having
something more general.

The reason for supporting the *.d directories was that I spotted a lot
of hooks people had hacked up at work using the pee(1) command[1] to
run sequences of other unrelated hook commands.

Just symlinking stuff is simpler and more portable if we do the work
in git.git once. We'd run  The pee(1) command also doesn't quit on the
first command that returns nonzero, which would make sense e.g. for
pre-commit hooks.

I have it working for the hooks that use the simple run_hook_ve()
interface, but the ones that have to e.g. pass input on stdin just
find_hook() directly & do a custom run_command(), so all of those
callsites would have to be patched and/or I'd have to hack up some
custom callback mechanism.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-04-26 21:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-22 23:51 RFC: Supporting .git/hooks/$NAME.d/* && /etc/git/hooks/$NAME.d/* Ævar Arnfjörð Bjarmason
2016-04-25 17:45 ` Junio C Hamano
2016-04-26 10:58   ` Ævar Arnfjörð Bjarmason
2016-04-26 13:40     ` Marc Branchaud
2016-04-26 16:09       ` Ævar Arnfjörð Bjarmason
2016-04-26 17:52         ` Christian Couder
2016-04-26 21:09         ` Marc Branchaud
2016-04-26 21:52     ` Junio C Hamano list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone