Re: [PATCH v2] add a flag to supress errors in git_config_parse_key()

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

 



On Mon, Feb 16, 2015 at 01:28:07PM +0530, Tanay Abhra wrote:

> I went through Junio's config guideline patch series
> and the whole thread of underscore bug report and I also think
> that pager.*.command is the right path to go.
> 
> If you want to relax the syntactic requirement (such as add '_' to
> the current set of allowed chacters), I can work upon it but most of the
> comments point that moving towards pager.*.command would be better.

No, as silly as I find the "_" restriction, it is not worth doing. One,
it would not cover all cases (it is one common case, so it makes the
problem more rare but does not eliminate it). And two, there are other
parsers of git's config format. Technically we do not need to care about
them and they can follow our lead, but we do not need to make things
harder on them than is necessary.

>  	if (last_dot == NULL || last_dot == key) {
> -		error("key does not contain a section: %s", key);
> +		if (!flags)
> +			error("key does not contain a section: %s", key);

The intent of the flag variable is that you would check:

  if (!(flags & CONFIG_ERROR_QUIET))

here. I know that there are no other flags yet, so the two are
equivalent. But when somebody adds a new flag later, you would not want
them to have to tweak each of these sites.

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