Re: [PATCH v3 07/13] git hook run: add an --ignore-missing flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> +	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?





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux