Re: [PATCH v4 5/5] fast-export: do automatic reencoding of commit messages only if requested

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

 



Elijah Newren <newren@xxxxxxxxx> writes:

> +static int parse_opt_reencode_mode(const struct option *opt,
> +				   const char *arg, int unset)
> +{
> +	if (unset || !strcmp(arg, "abort"))
> +		reencode_mode = REENCODE_ABORT;
> +	else if (!strcmp(arg, "yes") || !strcmp(arg, "true") || !strcmp(arg, "on"))
> +		reencode_mode = REENCODE_YES;
> +	else if (!strcmp(arg, "no") || !strcmp(arg, "false") || !strcmp(arg, "off"))
> +		reencode_mode = REENCODE_NO;

Don't duplicate the logic; find existing callers of git_parse_maybe_bool(),
learn what they are using the helper for and mimic them, perhaps?



[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