Re: Alternative approach to the git config NULL value checking patches..

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

 




On Sun, 10 Feb 2008, Junio C Hamano wrote:
> 
> I should have mentioned the reason why I did not suggest doing
> it this way in my [Janitor] message.
> 
> It is not "suttle difference between true and empty".  Empty
> means false, and with this approach, it switches the meaning of
> valueless form of config to quite the opposite.

No it does not.

> will now need to be changed to:
> 
> 	if (value == config_true)
>         	Ah we have true;
> 	else if (!*value)
>         	Ok this is false;

And that was done by my patch. 

> still need to be fixed to:
> 
> 	if (value == config_true)
>         	die("oops '%s' is not a bool", var);
> 	else if (!strcmp(value, "somevalue")
> 		Ok let's use somevalue;

And this is different from checking against NULL exactly how?

> > This also means that code (notably the value regexp parsing) that does 
> > something like
> >
> > 	value ? value : ""
> >
> > just automatically can go away, and just use 'value' directly.
> 
> Yes, but that's broken already, isn't it?

No, it was what the regex parsing logic was - empty matches empty. Whether 
we really want it or not, I dunno.

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

  Powered by Linux