Re: [PATCH v5 10/12] hook: move is_known_hook() to hook.c for wider use
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 27, 2026, 14:46 UTC
- Message-ID
- <acaYUU4FvEwWTaNu@pks.im>
- In-Reply-To
- <20260326101819.1307742-11-adrian.ratiu@collabora.com>
On Thu, Mar 26, 2026 at 12:18:17PM +0200, Adrian Ratiu wrote:
Show 15 quoted lines
> Move is_known_hook() from builtin/hook.c (static) into hook.c and > export it via hook.h so it can be reused. > > Make it return bool and the iterator `h` for clarity (iterate hooks). > > The next commit will use this to reject hook friendly-names that > collide with known event names. > > Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com> > --- > Makefile | 2 +- > builtin/hook.c | 10 ---------- > hook.c | 10 ++++++++++ > hook.h | 6 ++++++ > 4 files changed, 17 insertions(+), 11 deletions(-)
This needs to also be changed in Meson now, as we're adding "hook-list.h" as a dependency for the builtin sources, not for the libgit sources. Something like the below patch.
Patrick
diff --git a/meson.build b/meson.build index 1b0e431d5f..2536ea80ae 100644 --- a/meson.build +++ b/meson.build @@ -560,6 +560,18 @@ libgit_sources += custom_target( env: script_environment, ) +libgit_sources += custom_target( + input: 'Documentation/githooks.adoc', + output: 'hook-list.h', + command: [ + shell, + meson.current_source_dir() + '/generate-hooklist.sh', + meson.current_source_dir(), + '@OUTPUT@', + ], + env: script_environment, +) + builtin_sources = [ 'builtin/add.c', 'builtin/am.c', @@ -736,18 +748,6 @@ builtin_sources += custom_target( env: script_environment, ) -builtin_sources += custom_target( - input: 'Documentation/githooks.adoc', - output: 'hook-list.h', - command: [ - shell, - meson.current_source_dir() + '/generate-hooklist.sh', - meson.current_source_dir(), - '@OUTPUT@', - ], - env: script_environment, -) - # This contains the variables for GIT-BUILD-OPTIONS, which we use to propagate # build options to our tests. build_options_config = configuration_data()