git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-grep: add --color to highlight matches
Date: Sat, 24 May 2008 12:59:12 +0200	[thread overview]
Message-ID: <200805241259.13132.jnareb@gmail.com> (raw)
In-Reply-To: <fcaeb9bf0805240220x78943f8ap67344a508531faa0@mail.gmail.com>

On Sat, 24 May 2008, Nguyen Thai Ngoc Duy wrote:
> On Sat, May 24, 2008 at 3:28 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>>
>>> +--color::
>>> +     Show colored matches.
>>> +
>>
>> Why not borrow from GNU grep manpage?
>>
>>   --colour[=WHEN], --color[=WHEN]
>>      Surround  the  matching  string  with  the marker find in GREP_COLOR
>>      environment variable. WHEN may be 'never', 'always', or 'auto'
>>
>> We probably would also want it configurable (via config variables),
>> as `color.grep' I guess.

And color.grep.<slot>, where slot can be 'match', and probably later also
'context' (I don't remember if git-grep implements -C<num> option...).
 
> Yes. But this patch was really to scratch my itch and I felt good
> after having it colorized so did not bother with configuration system.
> I will probably make it a config var when I get tired of typing
> --color too often ;)

Thanks for sharing, although I guess Junio would prefer more complete
patch...

>> I think compatibility with grep (using GREP_COLOR) would be good idea,
>> and easily implemented.
> 
> I had no idea that variable existed.

Well, I have though that git always use external grep, so this would
be for free. After reading the patch more carefully it seems like it
isn't so.

Still, perhaps that would be a good idea, but I guess for later patch.
-- 
Jakub Narebski
Poland

  reply	other threads:[~2008-05-24 11:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-24  4:31 [PATCH] git-grep: add --color to highlight matches Nguyễn Thái Ngọc Duy
2008-05-24  8:28 ` Jakub Narebski
2008-05-24  9:20   ` Nguyen Thai Ngoc Duy
2008-05-24 10:59     ` Jakub Narebski [this message]
2008-05-26  8:55       ` Andreas Ericsson
2008-05-26 10:16         ` Johannes Schindelin
2008-05-26 10:57           ` Nguyen Thai Ngoc Duy
2008-05-26 11:00             ` Johannes Schindelin
2008-05-26 11:07               ` Nguyen Thai Ngoc Duy
2008-05-26 11:29                 ` Johannes Schindelin

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=200805241259.13132.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@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).