git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH] builtin/config.c: don't print a newline with --color
Date: Mon, 04 Mar 2019 14:05:40 +0900	[thread overview]
Message-ID: <xmqqh8cjw7ob.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqqlg1vw9f2.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Mon, 04 Mar 2019 13:28:01 +0900")

Junio C Hamano <gitster@pobox.com> writes:

> Jeff King <peff@peff.net> writes:
>
>> I'm not sure I agree. Colors have always been special, and
>> "--type=color" was advertised as a replacement for "--get-color". And
>> "--get-color" never output the newline.
>
> OK, that part of the motivation I completely missed.  If end-users
> and scripters are happy with the behaviour of --get-color that does
> not terminate its output with LF (which I think is a reasonable
> thing to do, as "color" is special in that context, i.e. having a
> dedicated --get option suitable for that type), as we advertise
> "--type=color" is the same as "--get-color" (only better), we need
> to special case it, and omitting LF at the end similarly does make
> sense.
>
>> With respect to backwards compatibility, my thinking on the matter was
>> basically:
>>
>>   1. Since --type=color was supposed to be a drop-in replacement for
>>      --get-color, it's a bug that they don't behave the same.
>>
>>   2. It's a fairly recent feature, so nobody really noticed the bug
>>      until recently (and it was in fact me who noticed and got annoyed
>>      by it). If it were an ancient behavior, we might think about
>>      retaining even bug compatibility, but that's not the case here.
>
> Now I think "we weren't consistent to begin with with --get-color,
> and treating --type=color as a special case is justifiable"; and I
> agree with the above two points.

Just to avoid an awkward situation where the ball gets dropped and
left on the floor forgotten, the above does not mean I am 100% happy
with the patch as posted.  There is no mention of --get-color
anywhere, let alone it shows the ANSI sequence without traililng LF,
which I would consider to be the most important part of the
justification.  It is much stronger than "I expected there won't be
any trailing LF from 'git config'", which was the only thing I
managed to read in the original and led to my response.

  reply	other threads:[~2019-03-04  5:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02  0:40 [PATCH] builtin/config.c: don't print a newline with --color Taylor Blau
2019-03-02 12:34 ` Eric Sunshine
2019-03-02 20:25 ` Johannes Schindelin
2019-03-03 17:24   ` Jeff King
2019-03-05 15:59     ` Johannes Schindelin
2019-03-06 23:44   ` Taylor Blau
2019-03-03  1:18 ` Junio C Hamano
2019-03-03 17:42   ` Jeff King
2019-03-04  4:28     ` Junio C Hamano
2019-03-04  5:05       ` Junio C Hamano [this message]
2019-03-05  4:20         ` Jeff King
2019-03-05  5:57           ` Junio C Hamano
2019-03-06 23:42             ` Taylor Blau
2019-03-07  0:50           ` Junio C Hamano
2019-03-07  2:57             ` Jeff King
2019-03-06 23:52 ` [PATCH v2] Documentation/config: note trailing newline with --type=color Taylor Blau
2019-03-07  2:58   ` Jeff King
2019-03-07  3:47     ` 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=xmqqh8cjw7ob.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.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).