Re: [RFC/PATCH 4/9] parse-options: add parse_opt_merge_filter()

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

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> +int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset)
> +{
> +	struct ref_filter *rf = opt->value;
> +	unsigned char sha1[20];
> +
> +	rf->merge = opt->long_name[0] == 'n'
> +		? REF_FILTER_MERGED_OMIT
> +		: REF_FILTER_MERGED_INCLUDE;

I would use starts_with("no-", opt->long_name) instead. I had a hard
time understanding why the letter 'n' was special while the
starts_with() version is self-explanatory.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]