{"thread":{"id":"46442","subject":"recursive grep doesn't respect --color=always inside submodules","startedAt":"2017-07-23T06:02:42Z","lastAt":"2017-07-24T17:42:19Z","messageCount":3,"participants":["Orgad Shaneh","Jacob Keller","Brandon Williams"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"324907","messageId":"CAGHpTB+dSGza5Lwg76WXg+pPZ=dz3QdCTnDozWG_y+5_bPor6A@mail.gmail.com","threadId":"46442","inReplyTo":null,"subject":"recursive grep doesn't respect --color=always inside submodules","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2017-07-23T06:02:36Z","receivedAt":"2017-07-23T06:02:42Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Hi,\n\nWhen git grep --color=always is used, and the output is redirected to\na file or a pipe, results inside submodules are not colored. Results\nin the supermodule are colored correctly.\n\n- Orgad\n"},{"id":"324910","messageId":"CA+P7+xrzLdGN1nkkcTH7iGBo1gg4GgPGYSgvF7-jw6LKj+WiBQ@mail.gmail.com","threadId":"46442","inReplyTo":"CAGHpTB+dSGza5Lwg76WXg+pPZ=dz3QdCTnDozWG_y+5_bPor6A@mail.gmail.com","subject":"Re: recursive grep doesn't respect --color=always inside submodules","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2017-07-23T08:10:19Z","receivedAt":"2017-07-23T08:14:57Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Sat, Jul 22, 2017 at 11:02 PM, Orgad Shaneh <orgads@gmail.com> wrote:\n> Hi,\n>\n> When git grep --color=always is used, and the output is redirected to\n> a file or a pipe, results inside submodules are not colored. Results\n> in the supermodule are colored correctly.\n>\n> - Orgad\n\nThis occurs because color isn't passed to the recursive grep submodule\nprocess we launch. It might be fixed if/when we switch to using the\nrepository object to run grep in-process. We could also patch grep to\npass the color option into the submodule.\n\nThanks,\nJake\n"},{"id":"324962","messageId":"20170724174128.GA68104@google.com","threadId":"46442","inReplyTo":"CA+P7+xrzLdGN1nkkcTH7iGBo1gg4GgPGYSgvF7-jw6LKj+WiBQ@mail.gmail.com","subject":"Re: recursive grep doesn't respect --color=always inside submodules","fromName":"Brandon Williams","fromEmail":"bmwill@google.com","sentAt":"2017-07-24T17:41:28Z","receivedAt":"2017-07-24T17:42:19Z","isPatch":false,"sender":{"key":"bwilliams.eng@gmail.com","avatar":null},"body":"On 07/23, Jacob Keller wrote:\n> On Sat, Jul 22, 2017 at 11:02 PM, Orgad Shaneh <orgads@gmail.com> wrote:\n> > Hi,\n> >\n> > When git grep --color=always is used, and the output is redirected to\n> > a file or a pipe, results inside submodules are not colored. Results\n> > in the supermodule are colored correctly.\n> >\n> > - Orgad\n> \n> This occurs because color isn't passed to the recursive grep submodule\n> process we launch. It might be fixed if/when we switch to using the\n> repository object to run grep in-process. We could also patch grep to\n> pass the color option into the submodule.\n\nThis is one of the many downsides to the multi-process approach as it is\nvery easy to miss passing configuration like '--color' down to the\nsubmodules.  As Jacob pointed out this problem is solved when the\nrecursion is handled in-process.  The series to implement this is\ncurrently under-review.  The latest version of the patch series you can\nfind here\n(https://public-inbox.org/git/20170718190527.78049-1-bmwill@google.com/)\nand it looks like Junio has it as a branch on github at\n(https://github.com/gitster/git/tree/bw/grep-recurse-submodules).\n\n-- \nBrandon Williams\n"}]}