git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: recursive grep doesn't respect --color=always inside submodules

From
BWBrandon Williams <bmwill@google.com>
Date
Jul 24, 2017, 17:41 UTC
Message-ID
<20170724174128.GA68104@google.com>
In-Reply-To
<CA+P7+xrzLdGN1nkkcTH7iGBo1gg4GgPGYSgvF7-jw6LKj+WiBQ@mail.gmail.com>
On 07/23, Jacob Keller wrote:
Show 13 quoted lines
> 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
Previous: Jacob Keller
Message 3 of 3 in “recursive grep doesn't respect --color=always inside submodules”
  1. Orgad ShanehJul 23, 2017
  2. Jacob KellerJul 23, 2017
  3. Brandon WilliamsJul 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.