From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Alternative approach to the git config NULL value checking patches..
Date: Mon, 11 Feb 2008 00:12:53 -0800 [thread overview]
Message-ID: <7vzlu7ap2y.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200802110822.08902.chriscool@tuxfamily.org> (Christian Couder's message of "Mon, 11 Feb 2008 08:22:08 +0100")
Christian Couder <chriscool@tuxfamily.org> writes:
> Now the 10% are only when we have a boolean variable and we want it to
> be "false" when there is:
>
> [foo]
> var =
>
> while:
>
> [foo]
> var
>
> is considered "true".
>
> And let's face it, it's not obvious at all why it should be false if there
> is "var =" and true when there is only "var". Is it a Microsoft standard ?
> Do we really care about it ?
> ...
> I also doubt that many users willingly use "var =" to mean "false".
Some variables started their life as boolean and "[foo] var" is
true and "[foo] var = false" (or "= 0") is false for them; later
they acquired third or more options to have string values.
For such a variable:
[foo] var ; boolean "true"
[foo] var = "true" ; boolean "true"
[foo] var = "false" ; boolean "false"
[foo] var = "" ; boolean "false", too.
[foo] var = ; perhaps misspelled, perhaps the same as above.
[foo] var = "value" ; string (new semantics)
and adding a warning for the fifth one (but not fourth one)
might be a good idea.
I have a bit stronger opinion on keeping "[foo] var" (without an
equal sign) to stay "true". Especially, making it exactly the
same as an empty string is unacceptable, if it is done without
Linus's trick to make it distinguishable internally.
Luckily, the calls to get_config_set() we internally make
in-tree (e.g. git-init sets core.filemode and friends) are all
very explicit and do not write "[foo] var" form of truth. But
many existing docs written outside our (my) control that google
finds say "Put '[core] autocrlf' in your .git/config". You do
not want to break the repositories configured following such an
advice.
> So let's do them (and ourself too) a favor and deprecate "var =" to mean
> false. I will post my patch to do this.
Don't do it if you cannot differentiate between the fourth and
the fifth in the above listing.
next prev parent reply other threads:[~2008-02-11 8:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-10 20:32 Alternative approach to the git config NULL value checking patches Linus Torvalds
2008-02-10 21:25 ` Junio C Hamano
2008-02-10 22:08 ` Linus Torvalds
2008-02-10 22:29 ` Junio C Hamano
2008-02-10 22:47 ` Junio C Hamano
2008-02-10 23:29 ` Pierre Habouzit
2008-02-10 23:50 ` Linus Torvalds
2008-02-10 23:36 ` Linus Torvalds
2008-02-10 23:41 ` Linus Torvalds
2008-02-11 0:40 ` Junio C Hamano
2008-02-11 7:22 ` Christian Couder
2008-02-11 8:12 ` Junio C Hamano [this message]
2008-02-11 17:27 ` Daniel Barkalow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vzlu7ap2y.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).