commit: use hook.h to execute hooks
authorEmily Shaffer <emilyshaffer@google.com>
Mon, 14 Jun 2021 10:33:01 +0000 (12:33 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2021 01:09:24 +0000 (10:09 +0900)
commita97af154c4311455e7d931f19d036b14040acfeb
treef3b24f15ad8b77a0090f2f576ef8dbfd11bc7068
parentfdd532abf3341f4f7fab1e3b8b45ea10f17a2670
commit: use hook.h to execute hooks

Teach run_commit_hook() to call hook.h instead of run-command.h. This
covers 'pre-commit', 'commit-msg', and
'prepare-commit-msg'.

Additionally, ask the hook library - not run-command - whether any
hooks will be run, as it's possible hooks may exist in the config but
not the hookdir.

Because all but 'post-commit' hooks are expected to make some state
change, force all but 'post-commit' hook to run in series. 'post-commit'
"is meant primarily for notification, and cannot affect the outcome of
`git commit`," so it is fine to run in parallel.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
commit.c
sequencer.c