From: Junio C Hamano Date: Sun, 20 May 2012 22:29:44 GMT Subject: Re: [PATCH 3/3] grep: support newline separated pattern list Message-ID: <7vobpia3l3.fsf@alter.siamese.dyndns.org> In-Reply-To: <4FB900A3.9050309@lsrfire.ath.cx> René Scharfe writes: > Currently, patterns that contain newline characters don't match anything > when given to git grep. Regular grep(1) interprets patterns as lists of > newline separated search strings instead. > > Implement this functionality by creating and inserting extra grep_pat > structures for patterns consisting of multiple lines when appending to > the pattern lists. For simplicity, all pattern strings are duplicated. > The original pattern is truncated in place to make it contain only the > first line. Thanks for a fix; I am assuming that the duplication for simplicity is not for simplified allocation but primarily for a simpler freeing?