From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Jeff King <peff@peff.net>,
git@vger.kernel.org,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH 3/3] CodingGuidelines: describe naming rules for configuration variables
Date: Mon, 02 Feb 2015 10:54:22 -0800 [thread overview]
Message-ID: <xmqq386ouotd.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54CF1D7F.6050903@alum.mit.edu> (Michael Haggerty's message of "Mon, 02 Feb 2015 07:47:27 +0100")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> You make an interesting point: values that start as a list of
> independent booleans can grow dependencies over time.
>
> In retrospect, ISTM that a better interface for the indentation-related
> "whitespace" settings would have been something like
>
> * "whitespace.indent" -- a single value chosen from "tabs-only |
> spaces-only | tabs-when-possible | anything"
> * "whitespace.tabwidth" -- an integer value
>
> This would have made the mutual-exclusivity of those choices manifest in
> the style of configuration rather than hoping that the user notices that
> his settings contradict each other.
>
> Let's dig into this example some more by imagining some other
> hypothetical future extensions.
Let's not; that line of thought entirely misses the point. If you
start from one set of variables, you can define a structure
(e.g. "there are indentation-related and you must choose only one
among them") over it after the fact.
Once you have chosen a structure, you have to live with it. Either
you make sure that a structure itself is extensible, or you make
sure you accept a new variable only if it fits within a structure.
Either way, you lose. You cannot predict the future, and you do not
want to constrain those who will contribute to the project in the
future.
My aversion to one-variable-per-knob was primarily against the
"because that is how the variables are internally represented; a
collection of enums that can be independently set" argument. If we
assume that one-variable-per-knob style implies variables that can
be independently set, that _is_ defining the structure the future
work has to live within.
But as I and Peff discussed in the other sub(sub)thread, having two
variables placed flatly in the namespace, e.g. ws.indentWithTab and
ws.noTabInIndent, does not have to mean they are independent.
And the opposite is also true; having these two knobs as possible
elements of the value of a single variable does not imply they
always have meaningful interactions.
So I am fine with "fsck.missingTagger = ignore/warn/error", as long
as the argument that supports the style is not "because
fsck.missingTagger and fsck.malformedIdent are independent".
prev parent reply other threads:[~2015-02-02 18:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 16:55 [PATCH] Documentation/git-add.txt: add `add.ginore-errors` configuration variable Alexander Kuleshov
2015-01-26 21:58 ` Eric Sunshine
2015-01-27 20:17 ` Junio C Hamano
2015-01-28 22:33 ` [PATCH 0/3] Documenting naming rules for configuration variables Junio C Hamano
2015-01-28 22:33 ` [PATCH 1/3] config.txt: clarify that add.ignore-errors is deprecated Junio C Hamano
2015-01-28 22:33 ` [PATCH 2/3] config.txt: mark deprecated variables more prominently Junio C Hamano
2015-01-28 22:33 ` [PATCH 3/3] CodingGuidelines: describe naming rules for configuration variables Junio C Hamano
2015-02-01 5:12 ` Michael Haggerty
2015-02-01 16:44 ` Jeff King
2015-02-01 20:18 ` Junio C Hamano
2015-02-01 21:57 ` Jeff King
2015-02-01 22:34 ` Junio C Hamano
2015-02-02 11:31 ` Johannes Schindelin
2015-02-02 18:39 ` Junio C Hamano
2015-02-02 6:47 ` Michael Haggerty
2015-02-02 18:54 ` Junio C Hamano [this message]
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=xmqq386ouotd.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
/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.