Re: bug? illegal text in commit log
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2020, 05:40 UTC
- Message-ID
- <xmqqlfpf3qh3.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <e271bb17-376d-426f-61b2-86971f1cb02b@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 19 quoted lines
>> * the first line that >> - begins with "diff " or "Index", or >> - is "---" (and nothing else on the line) >> signals that the line no longer is part of the log >> >> * but if it finds a line that begins with "diff --git" (or >> optionally just "diff "), do not blindly assume that is the end >> of the log, and instead try to find the first "---" line. If >> there isn't any "---", then take that "diff" line the beginning >> of the patch, but if there is, "---" is the end of the message. >> >> The latter rule is the new one. And there is no need to change >> format-patch output. > > I like this idea. It will probably be tricky to implement, though, > as mailinfo currently goes through the input line by line and has no > easy way to look ahead. > > René
Another issue with the approach is that it will be fooled if the patch is about removing a line with double-dash and nothing else on it. Unless we can trust the numbers on hunk header lines in the "sample patch" embedded in the log message, we cannot reliably tell if a line with "---" on it is such a line, or the true end of the log message.