Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted hunk
+ int ignore_missing = 0;
const char *hook_name;
const char *hook_path;
struct option run_options[] = {
+ OPT_BOOL(0, "ignore-missing", &ignore_missing,
+ N_("silently ignore missing requested <hook-name>")),
OPT_END(),
};
int ret;@@ -53,6 +56,8 @@ static int run(int argc, const char **argv, const char *prefix)
git_config(git_default_config, NULL);
hook_name = argv[0];
+ if (ignore_missing)
+ return run_hooks_oneshot(hook_name, &opt);
hook_path = find_hook(hook_name);
if (!hook_path) {
error("cannot find a hook named %s", hook_name);
Given that the rest of this "run()" function is more or less
identical to run_hooks_oneshot(), I have to wonder why we do not
give an .ignore_missing member to the hooks_opt structure to be done
with this. Otehrwise, every time the underlying run_hooks()
interface needs to change, we need to update two places, no?