Re: git-am applies commit message diffs
From: Florian Weimer <hidden>
Date: 2026-02-06 09:48:38
* Jeff King:
On Fri, Feb 06, 2026 at 09:59:31AM +0100, Florian Weimer wrote:quoted
Isn't the format-patch output already unambiguous because the sequence of diffs is preceeded by the non-diff statistics section, and only then the commit message follows? It's just not possible to process this correctly in one pass because only at the end of the input, you know that you have just seen the to-be-applied diffs.That diffstat is optional, and not parsed by the receiving format-patch at all. Keep in mind that in the world for which it was originally designed, people were not necessarily using Git to generate their emails. They could be patches emailed by random folks using "diff" themselves.
Is the git am format that flexible in practice? I often have trouble applying patches with git am that were created with git format-patch and have to resort to plain old patch instead. As a user, I definitely get the impression that it's not a type of tool that gets a patch out of an email message, no matter what the cost. Thanks, Florian