Re: [PATCH v3] line-range: Fix infinite loop bug with degenerate '$' regex
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2022, 03:34 UTC
- Message-ID
- <xmqq1qp6wr46.fsf@gitster.g>
- In-Reply-To
- <xmqq5yeiwr6x.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> Lars Kellogg-Stedman <lars@oddbit.com> 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.