* recursive grep doesn't respect --color=always inside submodules
@ 2017-07-23 6:02 Orgad Shaneh
2017-07-23 8:10 ` Jacob Keller
0 siblings, 1 reply; 3+ messages in thread
From: Orgad Shaneh @ 2017-07-23 6:02 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: recursive grep doesn't respect --color=always inside submodules
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
0 siblings, 1 reply; 3+ messages in thread
From: Jacob Keller @ 2017-07-23 8:10 UTC (permalink / raw)
To: Orgad Shaneh; +Cc: git
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.
Thanks,
Jake
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: recursive grep doesn't respect --color=always inside submodules
2017-07-23 8:10 ` Jacob Keller
@ 2017-07-24 17:41 ` Brandon Williams
0 siblings, 0 replies; 3+ messages in thread
From: Brandon Williams @ 2017-07-24 17:41 UTC (permalink / raw)
To: Jacob Keller; +Cc: Orgad Shaneh, git
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-24 17:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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).