git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Stefan Beller <sbeller@google.com>
Subject: Re: [RFC PATCH 3/4] color.ui config: don't die on unknown values
Date: Thu, 31 May 2018 09:17:41 +0200	[thread overview]
Message-ID: <87h8mo9tuy.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqin74d9rh.fsf@gitster-ct.c.googlers.com>


On Wed, May 30 2018, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Before this change git will die on any unknown color.ui values:
>>
>>     $ git -c color.ui=doesnotexist show
>>     fatal: bad numeric config value 'doesnotexist' for 'color.ui': invalid unit
>
> I do not think "unit" is correct, so there may be some room for
> improvement.  For _this_ particular case, I agree that it is not the
> end of the world if we did not color the output (because we do not
> know what the 'doesnotyetexist' token from the future is trying to
> tell us), but as a general principle, we should diagnose and die, if
> a misconfiguration is easy to correct.

Many users (including myself) use the same ~/.gitconfig on many
different machines with different git versions. Maybe at some point I'm
willing to set the new setting to a value I know is supported on most of
them, but it sucks at that point if I logging into 1-3% of old machines
ends up killing git on any invocation.

> than blindly go ahead and do random things that the end-user did not
> expect by giving something we do not (but they thought they do)
> understand.

I think this is highly dependent on what variables we give this
treatment. There may be some where we genuinely have no idea what they
mean, but in this case and for http.sslVersion (which warns, doesn't die
on unknown values) it's reasonable to assume that degrading to a known
value is better than outright dying.

> If we really want to introduce "here is a setting you may not
> understand, in which case you may safely ignore", the right way to
> do so is to follow the model the index extension took, where from
> the syntax of the unknown thing an old/existing code can tell if it
> is optional.  Forcing all codepaths to forever ignore what they do
> not understand and what they happen to think is a safe fallback is
> simply being irresponsible---the existing code does not understand
> the new setting so they do not even know if their "current
> behaviour" as a fallback is a safe and sensible one from the point
> of view of the person who asked for the feature from the future.

This seems needlessly complex. color.ui is one of the most prominent
config variales, so you're proposing we split it up into some dual-key
arrangement and force all users to migrate? I think just following what
we're doing with http.sslVersion makes more sense.

  reply	other threads:[~2018-05-31  7:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30 21:06 [PATCH 0/4] color.ui docs & add color.ui=isatty Ævar Arnfjörð Bjarmason
2018-05-30 21:06 ` [PATCH 1/4] config doc: move color.ui documentation to one place Ævar Arnfjörð Bjarmason
2018-05-31  5:25   ` Jeff King
2018-05-31  7:09     ` Ævar Arnfjörð Bjarmason
2018-06-01  5:31       ` Jeff King
2018-05-30 21:06 ` [PATCH 2/4] config doc: clarify "to a terminal" in color.ui Ævar Arnfjörð Bjarmason
2018-05-31  5:27   ` Jeff King
2018-05-30 21:06 ` [RFC PATCH 3/4] color.ui config: don't die on unknown values Ævar Arnfjörð Bjarmason
2018-05-30 22:32   ` Stefan Beller
2018-05-30 23:05   ` Junio C Hamano
2018-05-31  7:17     ` Ævar Arnfjörð Bjarmason [this message]
2018-06-01  5:53       ` Jeff King
2018-05-30 21:06 ` [RFC PATCH 4/4] color.ui config: add "isatty" setting Ævar Arnfjörð Bjarmason
2018-05-30 22:57   ` Junio C Hamano
2018-05-31  7:07     ` Ævar Arnfjörð Bjarmason
2018-05-31  5:38   ` Jeff King
2018-05-31  7:01     ` Ævar Arnfjörð Bjarmason
2018-06-01  5:30       ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8mo9tuy.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).