On Tue, Aug 21, 2018 at 01:57:07PM -0700, Junio C Hamano wrote: > Jeff King <peff@xxxxxxxx> writes: > > > Ah, yeah, I think you're right. We call find_patch_start(), which thinks > > the "---" line is the end of the commit message. That makes sense when > > parsing trailers out of "format-patch" output, but not when we know we > > have just the commit message. > > Yes, but that does not explain what we are seeing. If the code > mistakenly thinks that the log message ends before that table, then > it should have inserted the S-o-b: _before_ that table, but that is > not happening. > > So there are three issues; (1) find-patch-start uses too weak a > logic to find the beginning of a patch section (2) even if it found > the right place, its caller does not tell "commit --amend -s" where > the log message ends correctly and (3) some callchains that get > there know they only have a log message but there is no way to take > advantage of that information and skip the call to find-patch-start. Yes, I'd agree with all of that. I'm going offline, so if you are part-way through a patch, please do not worry that we might duplicate effort. :) -Peff