git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lodato <lodatom@gmail.com>
To: Michael Witten <mfwitten@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/5] grep: Colorize filename, line number, and separator
Date: Tue, 2 Mar 2010 23:26:36 -0500	[thread overview]
Message-ID: <ca433831003022026pbc172d6ocb5ff2aefe29f462@mail.gmail.com> (raw)
In-Reply-To: <4b8cb38b.870fcc0a.7ebc.1a83@mx.google.com>

On Tue, Mar 2, 2010 at 1:43 AM, Michael Witten <mfwitten@gmail.com> wrote:
>> By the way, the default should be 'always', not
>> 'auto', to be consistent with GNU tools, and to be backwards
>> compatible with the old --color behavior.
>
> Well, I've got:
>
>    GNU grep 2.5.4
>
> and the default for a plain `--color' seems to be `auto', whereby
> colorization is turned on when stdout is attached to a tty capable
> of color, but turned off otherwise:

Sorry, that was my mistake about GNU grep.  However, GNU ls (coreutils
7.4) defaults to 'always'.  So, GNU tools are not consistent in this
regard.  Furthermore, the current behavior of all git tools is to make
--color turn on color always, so I imagine you would have to make an
extremely compelling argument to break backwards compatibility.  I'll
add that this behavior makes the most sense, since most folks who use
color have done `git config color.ui auto'.  This is why no one have
created this patch until now.  The [=<when>] part is nice, but the git
config infrastructure usually obviates the need for --color=auto.

> Firstly, note that GNU understands a wide set of option arguments:
>
>    1: always , yes , force
>    0: never  , no  , none
>    2: auto   , tty , if-tty

I guess this is okay, but I don't see a need for it.  If we allow
these other synonyms, then we'll have to support them forever.  I say
just stick with always/never/auto for now, and we could add the others
later if there's a big demand.

> In my opinion, Git grep should follow GNU grep's conventions, not
> only to be consistent, but also because they are better.

It is more important to be consistent with the other git tools, so
that is why --color is a synonym for --color=always.

  reply	other threads:[~2010-03-03  4:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-27  4:57 [PATCH 0/5] color enhancements, particularly for grep Mark Lodato
2010-02-27  4:57 ` [PATCH 1/5] Allow explicit ANSI codes for colors Mark Lodato
2010-02-27  8:51   ` Jeff King
2010-02-27 18:24     ` Mark Lodato
2010-02-27 21:21       ` Junio C Hamano
2010-02-28  2:56         ` [PATCH] color: allow multiple attributes Junio C Hamano
2010-02-28 12:20           ` Jeff King
2010-02-28 18:16             ` Junio C Hamano
2010-02-28 18:33               ` Jeff King
2010-02-27  4:57 ` [PATCH 2/5] Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_* Mark Lodato
2010-02-27  4:57 ` [PATCH 3/5] Remove reference to GREP_COLORS from documentation Mark Lodato
2010-02-27  4:57 ` [PATCH 4/5] grep: Colorize filename, line number, and separator Mark Lodato
2010-02-27 11:43   ` René Scharfe
2010-02-28 20:14     ` Mark Lodato
2010-02-28 22:26       ` Michael Witten
2010-03-02  1:49         ` Mark Lodato
2010-03-02  6:43           ` Michael Witten
2010-03-03  4:26             ` Mark Lodato [this message]
2010-03-03  4:49               ` Miles Bader
2010-02-27 11:53   ` René Scharfe
2010-02-27 17:08     ` Junio C Hamano
2010-02-28 20:15       ` Mark Lodato
2010-02-28 19:29   ` Junio C Hamano
2010-02-28 20:39     ` Mark Lodato
2010-02-27  4:57 ` [PATCH 5/5] grep: Colorize selected, context, and function lines Mark Lodato

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=ca433831003022026pbc172d6ocb5ff2aefe29f462@mail.gmail.com \
    --to=lodatom@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mfwitten@gmail.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.
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 NNTP newsgroup(s).