Re: [PATCH 3/3] templates: detect messages that contain a separator line
- From
Jeff King <peff@peff.net>
- Date
- Feb 9, 2026, 07:00 UTC
- Message-ID
- <20260209070018.GB585828@coredump.intra.peff.net>
- In-Reply-To
- <xmqqldh4b5y2.fsf@gitster.g>
On Sat, Feb 07, 2026 at 01:27:01PM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> I have no qualms about the topic up to the previous step, but I know > one of the things that I sometimes do will be broken with the change > in this step, namely, when I know what I want to write below the > three-dash lines, I would commit with "---" and additional notes > below it, so that I do not forget during "format-patch". > > When the commit is turned into a patch email, possibly with some > other material like "--notes=<ref>" that adds notes there, the > resulting message will have two three-dashes lines, but because "am" > cuts at the first one, and "apply" knows that the garbage lines at > front, including three-dash lines, do not matter until it sees "^diff", > this works out perfectly well. > > Admittedly, I myself do not send out so many patches as I used to, > but I suspect that there are others who have discovered this trick > independently, and they would be unhappy to be interrupted by > commit-msg hook like this.
I do it, too, though not all that often. Once upon a time I had a patch to teach git-commit to auto-convert lines after "---" into a note (which would then be formatted back out via format-patch). But I found for my git.git workflow that just letting the "---" ride along in the commit object was simpler and easier (since I don't care about having pristine commit objects, as their ultimate fate is to be dropped in favor of what is applied upstream).
-Peff