Subject: Re: [PATCH v3] line-range: Fix infinite loop bug with degenerate '$' regex

From: Junio C Hamano <[email-masked]>
Date: Sun, 11 Dec 2022 12:34:17 +0900

Junio C Hamano <[email-masked]> writes:

> Lars Kellogg-Stedman <[email-masked]> writes:
>
>> When the -L argument to "git log" is passed the degenerate regular
>> expression "$" (as in "-L :$:line-range.c"), this results in an
>> infinite loop in find_funcname_matching_regexp().
>
> Is "matching an empty line" the only way a regular expression can be
> a "degenerate" one?  If not, perhaps being a bit more explicit would
> help the readers, e.g.
>
>     ... a regular expression that matches any line, even an empty
>     one, such as "-L :$:line-range.c", this results in ...

I forgot to point out that the above comment on "degenerate" applies
equally to the commit title (which matters more).  Also, please do
not upcase the first word after "<area>:" on the title line.

Thanks.