git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Making a patch: "git format-patch" does not produce the documented format

From
Dale R. Worley <worley@alum.mit.edu>
Date
Aug 2, 2013, 22:11 UTC
Message-ID
<201308022211.r72MBT9G020153@freeze.ariadne.com>
In-Reply-To
<20130731214818.GP2337@serenity.lan>
Show 12 quoted lines
> From: John Keeping <john@keeping.me.uk>
> 
> git-format-patch(1) says:
> 
>         By default, the subject of a single patch is "[PATCH] " followed
>         by the concatenation of lines from the commit message up to the
>         first blank line (see the DISCUSSION section of git-commit(1)).
> 
> I think that accurately describes what you're seeing.  The referenced
> DISCUSSION section describes how to write a commit message that is
> formatted in a suitable way, with a short first subject line and then a
> blank line before the body of the message.

Thanks for the confirmation. I've figured out what is going wrong: Documentation/SubmittingPatches says:

    The first line of the commit message should be a short description (50
    characters is the soft limit, see DISCUSSION in git-commit(1)), and
    should skip the full stop.

What it *doesn't* say is that the second line of the commit message should be empty -- precisely so that git format-patch turns the first line into the Subject: but does not merge the remainder of the commit message (the "body") into the Subject: line. Now that I know to look for this, I can see that the commit messages in the Git repository show this pattern.

I'm preparing some clarifications of SubmittingPatches to explain things that a new person (e.g., me) would not know. To fix this issue, I am inserting:

    This first line should be a separate paragraph, that is, it should be
    followed by an empty line, which is then followed by the body of the
    commit message.
Dale
Previous: John KeepingNext: Junio C Hamano
Message 3 of 4 in “Making a patch: "git format-patch" does not produce the documented format”
  1. Dale R. WorleyJul 31, 2013
  2. John KeepingJul 31, 2013
  3. Dale R. WorleyAug 2, 2013
  4. Junio C HamanoAug 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.