All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brandon Williams <bmwill@google.com>
To: Jacob Keller <jacob.keller@gmail.com>
Cc: Orgad Shaneh <orgads@gmail.com>, git <git@vger.kernel.org>
Subject: Re: recursive grep doesn't respect --color=always inside submodules
Date: Mon, 24 Jul 2017 10:41:28 -0700	[thread overview]
Message-ID: <20170724174128.GA68104@google.com> (raw)
In-Reply-To: <CA+P7+xrzLdGN1nkkcTH7iGBo1gg4GgPGYSgvF7-jw6LKj+WiBQ@mail.gmail.com>

On 07/23, Jacob Keller wrote:
> On Sat, Jul 22, 2017 at 11:02 PM, Orgad Shaneh <orgads@gmail.com> wrote:
> > Hi,
> >
> > When git grep --color=always is used, and the output is redirected to
> > a file or a pipe, results inside submodules are not colored. Results
> > in the supermodule are colored correctly.
> >
> > - Orgad
> 
> This occurs because color isn't passed to the recursive grep submodule
> process we launch. It might be fixed if/when we switch to using the
> repository object to run grep in-process. We could also patch grep to
> pass the color option into the submodule.

This is one of the many downsides to the multi-process approach as it is
very easy to miss passing configuration like '--color' down to the
submodules.  As Jacob pointed out this problem is solved when the
recursion is handled in-process.  The series to implement this is
currently under-review.  The latest version of the patch series you can
find here
(https://public-inbox.org/git/20170718190527.78049-1-bmwill@google.com/)
and it looks like Junio has it as a branch on github at
(https://github.com/gitster/git/tree/bw/grep-recurse-submodules).

-- 
Brandon Williams

      reply	other threads:[~2017-07-24 17:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-23  6:02 recursive grep doesn't respect --color=always inside submodules Orgad Shaneh
2017-07-23  8:10 ` Jacob Keller
2017-07-24 17:41   ` Brandon Williams [this message]

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=20170724174128.GA68104@google.com \
    --to=bmwill@google.com \
    --cc=git@vger.kernel.org \
    --cc=jacob.keller@gmail.com \
    --cc=orgads@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.