Thread (1 message) 1 message, 1 author, 2026-02-06

Re: [PATCH 0/4] Specify hooks via configs

From: Junio C Hamano <hidden>
Date: 2026-02-06 16:26:31

Adrian Ratiu [off-list ref] writes:
Hello everyone,

This series adds a new feature: the ability to specify commands to run
for hook events via config entries (including shell commands).

The config schema is identical to the one developed by Emily and AEvar
a few years ago [1] though the implementation is significantly different
because it's based on the new / cleaned-up hook.[ch] APIs. [2].

For simplicity, hooks are still executed sequentially (.jobs == 1) in
this series, just like before. Parallel execution will be enabled in
a separate series based on this one.

The hook execution order is this:
1. Hooks read from the config. If multiple hook commands are specified
   for a single event, they are executed in config discovery order.
2. The default hooks from the hookdir.

The above order can be changed if necessary.

Again, this is based on the latest v8 hooks-conversion series [2] which
has not yet landed in next or master.
One thing missing to help those who haven't seen earlier iterations
of this topic is why we would want to do this.  Instead of dropping
a shell script or a custom program "foo" in .git/hooks/ directory,
you can tell the system to run program X when you want to run "foo"
hook.  The reason why somebody may want to do so is ...?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help