Re: git-am applies commit message diffs
From: Kristoffer Haugsbakk <hidden>
Date: 2026-02-11 15:23:23
On Wed, Feb 11, 2026, at 08:47, Jeff King wrote:
On Tue, Feb 10, 2026 at 06:34:05PM -0800, Jacob Keller wrote:quoted
quoted
Hmm. If we add a new unambiguous marker after the ---, old versions would see '...' and know to cut the description. New versions would wait for <NEW MARKER> and properly ignore any diff/etc prior to this. Since <NEW MARKER> is after a ---, it would be ignored and not inserted as part of the commit message, and because all versions universally accept cruft between --- and the diff start, this should be acceptable right?Keeping in mind we'd have to use <NEW MARKER> as something that we somehow reject as being a valid part of a commit message somehow, so that you can't accidentally insert it, and we'd need to be careful about rejecting formatting such a patch, and probably complaining on the receiving end if we see multiple markers.. Trickier than it sounds I imagine.Yeah, on reading your first message, I wondered if we would run into a commit message adding "---" followed by the new marker. If the new marker is forbidden, I guess that works. But how ugly is that new marker going to be, then? ;) We'll now see it in every email.
Maybe it could be something like `<symbols><space>`? It’s difficult to accidentally get a trailing whitespace into a commit.
If we are going to modify what format-patch produces, I'd be more inclined to have it perform some reversible quoting on the commit message so that "---" and "diff" lines are not recognized. And then that quoting only has to kick in when a message would be ambiguous, so most people wouldn't even see it.
This sounds better anyway.
[snip]