help.sp help.s help.o: command-list.h
builtin/bugreport.sp builtin/bugreport.s builtin/bugreport.o: hook-list.h
-builtin/hook.sp builtin/hook.s builtin/hook.o: hook-list.h
+hook.sp hook.s hook.o: hook-list.h
builtin/help.sp builtin/help.s builtin/help.o: config-list.h GIT-PREFIX
builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
#include "environment.h"
#include "gettext.h"
#include "hook.h"
-#include "hook-list.h"
#include "parse-options.h"
#define BUILTIN_HOOK_RUN_USAGE \
#define BUILTIN_HOOK_LIST_USAGE \
N_("git hook list [--allow-unknown-hook-name] [-z] [--show-scope] <hook-name>")
-static int is_known_hook(const char *name)
-{
- const char **p;
- for (p = hook_name_list; *p; p++)
- if (!strcmp(*p, name))
- return 1;
- return 0;
-}
-
static const char * const builtin_hook_usage[] = {
BUILTIN_HOOK_RUN_USAGE,
BUILTIN_HOOK_LIST_USAGE,
#include "environment.h"
#include "gettext.h"
#include "hook.h"
+#include "hook-list.h"
#include "parse.h"
#include "path.h"
#include "run-command.h"
#include "strbuf.h"
#include "strmap.h"
+bool is_known_hook(const char *name)
+{
+ const char **h;
+ for (h = hook_name_list; *h; h++)
+ if (!strcmp(*h, name))
+ return true;
+ return false;
+}
+
const char *find_hook(struct repository *r, const char *name)
{
static struct strbuf path = STRBUF_INIT;
*/
void hook_cache_clear(struct strmap *cache);
+/**
+ * Returns true if `name` is a recognized hook event name
+ * (e.g. "pre-commit", "post-receive").
+ */
+bool is_known_hook(const char *name);
+
/**
* Returns the path to the hook file, or NULL if the hook is missing
* or disabled. Note that this points to static storage that will be
env: script_environment,
)
+libgit_sources += custom_target(
+ input: 'Documentation/githooks.adoc',
+ output: 'hook-list.h',
+ command: [
+ shell,
+ meson.current_source_dir() + '/tools/generate-hooklist.sh',
+ meson.current_source_dir(),
+ '@OUTPUT@',
+ ],
+ env: script_environment,
+)
+
builtin_sources = [
'builtin/add.c',
'builtin/am.c',
env: script_environment,
)
-builtin_sources += custom_target(
- input: 'Documentation/githooks.adoc',
- output: 'hook-list.h',
- command: [
- shell,
- meson.current_source_dir() + '/tools/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()