From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Christian Couder <chriscool@tuxfamily.org>,
git@vger.kernel.org, johan@herland.net, josh@joshtriplett.org,
tr@thomasrast.ch, mhagger@alum.mit.edu, dan.carpenter@oracle.com,
greg@kroah.com, sunshine@sunshineco.com,
ramsay@ramsay1.demon.co.uk
Subject: Re: [PATCH v8 03/12] Move lower case functions into wrapper.c
Date: Thu, 27 Mar 2014 15:47:01 -0700 [thread overview]
Message-ID: <xmqqha6jcl96.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140327223406.GA32434@sigill.intra.peff.net> (Jeff King's message of "Thu, 27 Mar 2014 18:34:06 -0400")
Jeff King <peff@peff.net> writes:
> All bool config values allow "tRuE".
I was expecting somebody will bring it up, but think about it. Bool
is a very special case. Even among CS folks, depending on your
background, true may be True may be TRUE may be 1.
Conflating it with some random enum does not make a good argument.
> Ones that take "auto" often use
> strcasecmp (e.g., diff.*.binary). "blame.date" and "help.format" choose
> from a fixed set of tokens, but use strcmp.
I would say that the latter is the right thing to do.
> In general I do not see any reason _not_ to use strcasecmp for config
> values that are matching a fixed set. It's friendlier to the user,...
Actually, I think it ends up being hostile to the users to accept
random cases without a good reason. If you see two trailer elements
whose where are specified as "after" and "AFTER" in somebody's
configuration file, wouldn't that give a wrong impression that a new
line with the latter somehow has a stronger desire to come later
than the former?
If you consistently take only the fixed strings, you do not have to
worry about many people writing the same things in different ways,
confusing each other.
I would however fully agree with you that using strcasecmp() would
be the cleanest when reading and maintaining the code **IF** we want
to accept values in random case, but I do not agree that accepting
random cases is a good thing, so...
next prev parent reply other threads:[~2014-03-27 22:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-26 22:15 [PATCH v8 00/12] Add interpret-trailers builtin Christian Couder
2014-03-26 22:15 ` [PATCH v8 01/12] Add data structures and basic functions for commit trailers Christian Couder
2014-03-26 23:06 ` Junio C Hamano
2014-03-27 7:55 ` Christian Couder
2014-03-26 22:15 ` [PATCH v8 02/12] trailer: process trailers from stdin and arguments Christian Couder
2014-03-26 22:15 ` [PATCH v8 03/12] Move lower case functions into wrapper.c Christian Couder
2014-03-26 23:07 ` Junio C Hamano
2014-03-27 7:47 ` Christian Couder
2014-03-27 16:42 ` Junio C Hamano
2014-03-27 22:16 ` Junio C Hamano
2014-03-27 22:34 ` Jeff King
2014-03-27 22:47 ` Junio C Hamano [this message]
2014-03-27 22:56 ` Jeff King
2014-03-28 17:12 ` Junio C Hamano
2014-03-28 18:50 ` Jeff King
2014-03-28 7:02 ` Christian Couder
2014-03-26 22:15 ` [PATCH v8 04/12] trailer: read and process config information Christian Couder
2014-03-26 22:15 ` [PATCH v8 05/12] trailer: process command line trailer arguments Christian Couder
2014-03-26 22:15 ` [PATCH v8 06/12] trailer: parse trailers from stdin Christian Couder
2014-03-26 22:15 ` [PATCH v8 07/12] trailer: put all the processing together and print Christian Couder
2014-03-26 22:15 ` [PATCH v8 08/12] trailer: add interpret-trailers command Christian Couder
2014-03-26 22:15 ` [PATCH v8 09/12] trailer: add tests for "git interpret-trailers" Christian Couder
2014-03-26 22:15 ` [PATCH v8 10/12] trailer: execute command from 'trailer.<name>.command' Christian Couder
2014-03-26 22:15 ` [PATCH v8 11/12] trailer: add tests for commands in config file Christian Couder
2014-03-26 22:15 ` [PATCH v8 12/12] Documentation: add documentation for 'git interpret-trailers' Christian Couder
2014-03-26 23:05 ` [PATCH v8 00/12] Add interpret-trailers builtin Junio C Hamano
2014-03-27 7:53 ` Christian Couder
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=xmqqha6jcl96.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=chriscool@tuxfamily.org \
--cc=dan.carpenter@oracle.com \
--cc=git@vger.kernel.org \
--cc=greg@kroah.com \
--cc=johan@herland.net \
--cc=josh@joshtriplett.org \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
--cc=ramsay@ramsay1.demon.co.uk \
--cc=sunshine@sunshineco.com \
--cc=tr@thomasrast.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.