From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Duy Nguyen <pclouds@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] document behavior of empty color name
Date: Fri, 03 Feb 2017 10:12:13 -0800 [thread overview]
Message-ID: <xmqqy3xnf8jm.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170203122859.753bexioxxkibfzb@sigill.intra.peff.net> (Jeff King's message of "Fri, 3 Feb 2017 13:29:00 +0100")
Jeff King <peff@peff.net> writes:
> On Fri, Feb 03, 2017 at 04:24:30PM +0700, Duy Nguyen wrote:
>
>> > I don't think so. The default value is a git-config thing, but you would
>> > want to be able to do the same thing in a config file. For example, to
>> > disable coloring entirely for part of the diff, you could do:
>> >
>> > [color "diff"]
>> > meta = ""
>>
>> OK but it makes log.graphColors add empty colors though. In t4202.39,
>> we have " blue,invalid-color, cyan, red , ". With this patch the color
>> after red would be no color. Without it, we get a complaint and the
>> next color would be cycled back to blue. The test does not catch this
>> because the test graph does not have enough fork points to get to red
>> and back to blue.
>
> Right, I think that's the correct behavior. The empty color name is a
> real color ("none"), and you can put it in your list just like any other
> color.
Makes me wonder if we have a non-empty string that spells the same
"do nothing", because ...
> It's possible that somebody would like to use the sort of "hanging
> comma" behavior that people do with lists that might be added to later
> (e.g., for enums in C).
>
> IMHO that would be best handled by having the list-parsing code drop
> trailing empty entries.
... I agree with this position 100%, and while I have a suspicion
that real people do not necessarily want the "hanging comma"
behaviour, we would need a way to spell "I want a do-nothing color
at the end of this list, this is not a hanging comma" for
completeness, if we start supporting "hanging comma".
The above is just me "wondering"; I do not think what we have needs
further tweaks--an empty after the final comma that means "do-nothing"
is fine, I would think.
Thanks.
next prev parent reply other threads:[~2017-02-03 18:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 22:45 What's cooking in git.git (Jan 2017, #06; Tue, 31) Junio C Hamano
2017-02-01 0:21 ` [PATCH] color_parse_mem: allow empty color spec Jeff King
2017-02-01 1:19 ` Jacob Keller
2017-02-02 9:16 ` Duy Nguyen
2017-02-02 12:42 ` [PATCH] document behavior of empty color name Jeff King
2017-02-03 9:24 ` Duy Nguyen
2017-02-03 12:29 ` Jeff King
2017-02-03 18:12 ` Junio C Hamano [this message]
2017-02-04 0:49 ` Jeff King
2017-02-01 11:08 ` What's cooking in git.git (Jan 2017, #06; Tue, 31) Patrick Steinhardt
2017-02-01 18:40 ` Junio C Hamano
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=xmqqy3xnf8jm.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--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.
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).