]> Kevux Git Server - rit/commit
hook: allow out-of-repo 'git hook' invocations
authorEmily Shaffer <emilyshaffer@google.com>
Wed, 18 Feb 2026 22:23:51 +0000 (00:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 19 Feb 2026 21:24:39 +0000 (13:24 -0800)
commitb51e238ddf896439d2746b883d892f8f9bba649f
treedb0e317b5b8adaf1d2d807281784d22c0b07d1f0
parentd084fa2a915784d65257fbaff43f00b3ea5c8a44
hook: allow out-of-repo 'git hook' invocations

Since hooks can now be supplied via the config, and a config can be
present without a gitdir via the global and system configs, we can start
to allow 'git hook run' to occur without a gitdir. This enables us to do
things like run sendemail-validate hooks when running 'git send-email'
from a nongit directory.

It still doesn't make sense to look for hooks in the hookdir in nongit
repos, though, as there is no hookdir.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c
hook.c
t/t1800-hook.sh