5 #include "run-command.h"
8 /* The path to the hook */
14 /* Environment vars to be set for each hook */
17 /* Args to be passed to each hook */
20 /* Number of threads to parallelize across */
23 /* Resolve and run the "absolute_path(hook)" instead of
24 * "hook". Used for "git worktree" hooks
28 /* Path to initial working directory for subprocess */
31 /* Path to file which should be piped to stdin for each hook */
32 const char *path_to_stdin;
35 #define RUN_HOOKS_OPT_INIT { \
38 .args = STRVEC_INIT, \
42 * Callback provided to feed_pipe_fn and consume_sideband_fn.
46 const char *hook_name;
48 struct run_hooks_opt *options;
52 * Returns the path to the hook file, or NULL if the hook is missing
53 * or disabled. Note that this points to static storage that will be
54 * overwritten by further calls to find_hook and run_hook_*.
56 const char *find_hook(const char *name);
59 * A boolean version of find_hook()
61 int hook_exists(const char *hookname);
63 void run_hooks_opt_clear(struct run_hooks_opt *o);
66 * Calls find_hook(hookname) and runs the hooks (if any) with
69 int run_hooks(const char *hook_name, struct run_hooks_opt *options);
72 * Takes an already resolved hook and runs it. Internally the simpler
73 * run_hooks() will call this.
75 int run_found_hooks(const char *hookname, const char *hook_path,
76 struct run_hooks_opt *options);