{"thread":{"id":"34579","subject":"Making a patch: \"git format-patch\" does not produce the documented format","startedAt":"2013-07-31T21:31:47Z","lastAt":"2013-08-02T23:28:19Z","messageCount":4,"participants":["Dale R. Worley","John Keeping","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"224398","messageId":"201307312131.r6VLVliK028321@hobgoblin.ariadne.com","threadId":"34579","inReplyTo":null,"subject":"Making a patch: \"git format-patch\" does not produce the documented format","fromName":"Dale R. Worley","fromEmail":"worley@alum.mit.edu","sentAt":"2013-07-31T21:31:47Z","receivedAt":"2013-07-31T21:31:47Z","isPatch":false,"sender":{"key":"worley@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/19911107?v=4"},"body":"I'm working on writing a patch, but I'm running into a problem.  The\npatch itself is from this commit:\n\n    $ git log -1\n    commit 07a25537909dd277426818a39d9bc4235e755383\n    Author: Dale Worley <worley@ariadne.com>\n    Date:   Thu Jul 18 18:43:12 2013 -0400\n\n\topen() returns -1 on failure, and indeed 0 is a possible success value\n\tif the user closed stdin in our process.  Fix the test.\n    $ \n\nBut the output of \"git format-patch\" is:\n\n    From 07a25537909dd277426818a39d9bc4235e755383 Mon Sep 17 00:00:00 2001\n    From: Dale Worley <worley@ariadne.com>\n    Date: Thu, 18 Jul 2013 18:43:12 -0400\n    Subject: [PATCH] open() returns -1 on failure, and indeed 0 is a possible\n     success value if the user closed stdin in our process.  Fix\n     the test.\n\n    ---\n     t/t0070-fundamental.sh |    7 +++++++\n     wrapper.c              |    2 +-\n     2 files changed, 8 insertions(+), 1 deletions(-)\n\n    diff --git a/t/t0070-fundamental.sh b/t/t0070-fundamental.sh\n    index 986b2a8..d427f3a 100755\n    --- a/t/t0070-fundamental.sh\n    +++ b/t/t0070-fundamental.sh\n    @@ -25,6 +25,13 @@ test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints file\n\t    grep \"cannotwrite/test\" err\n    [...]\n\nNotice that the whole commit message has been formatted as if it is\npart of the Subject line, and the line breaks in the commit message\nhave been refilled.\n\nThe file Documentation/SubmittingPatches says that \"git format-patch\"\nproduces patches in the best format, but the manual page shows an\nexample more like this:\n\n    From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001\n    From: Tony Luck <tony.luck@intel.com>\n    Date: Tue, 13 Jul 2010 11:42:54 -0700\n    Subject: [PATCH] Put ia64 config files on the\n    MIME-Version: 1.0\n    Content-Type: text/plain; charset=UTF-8\n    Content-Transfer-Encoding: 8bit\n\n    arch/arm config files were slimmed down using a python script\n    (See commit c2330e286f68f1c408b4aa6515ba49d57f05beae comment)\n    [...]\n\nThat is, the first line of the commit message is in the Subject and\nthe remaining lines are in the message body.  As far as I can tell,\nthat's what SubmittingPatches prescribes.  And that is what I see in\nthe Git mailing list on vger.\n\n(This is with git 1.8.3.3.)\n\nExactly how should the commit message be inserted into the patch\ne-mail?  What needs to be updated so the code is consistent with the\ndocumentation?\n\nDale\n"},{"id":"224400","messageId":"20130731214818.GP2337@serenity.lan","threadId":"34579","inReplyTo":"201307312131.r6VLVliK028321@hobgoblin.ariadne.com","subject":"Re: Making a patch: \"git format-patch\" does not produce the documented format","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-31T21:48:19Z","receivedAt":"2013-07-31T21:48:19Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Jul 31, 2013 at 05:31:47PM -0400, Dale R. Worley wrote:\n> Notice that the whole commit message has been formatted as if it is\n> part of the Subject line, and the line breaks in the commit message\n> have been refilled.\n> \n> The file Documentation/SubmittingPatches says that \"git format-patch\"\n> produces patches in the best format, but the manual page shows an\n> example more like this:\n> \n>     From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001\n>     From: Tony Luck <tony.luck@intel.com>\n>     Date: Tue, 13 Jul 2010 11:42:54 -0700\n>     Subject: [PATCH] Put ia64 config files on the\n>     MIME-Version: 1.0\n>     Content-Type: text/plain; charset=UTF-8\n>     Content-Transfer-Encoding: 8bit\n> \n>     arch/arm config files were slimmed down using a python script\n>     (See commit c2330e286f68f1c408b4aa6515ba49d57f05beae comment)\n>     [...]\n> \n> That is, the first line of the commit message is in the Subject and\n> the remaining lines are in the message body.  As far as I can tell,\n> that's what SubmittingPatches prescribes.  And that is what I see in\n> the Git mailing list on vger.\n> \n> (This is with git 1.8.3.3.)\n> \n> Exactly how should the commit message be inserted into the patch\n> e-mail?  What needs to be updated so the code is consistent with the\n> documentation?\n\ngit-format-patch(1) says:\n\n        By default, the subject of a single patch is \"[PATCH] \" followed\n        by the concatenation of lines from the commit message up to the\n        first blank line (see the DISCUSSION section of git-commit(1)).\n\nI think that accurately describes what you're seeing.  The referenced\nDISCUSSION section describes how to write a commit message that is\nformatted in a suitable way, with a short first subject line and then a\nblank line before the body of the message.\n"},{"id":"224465","messageId":"201308022211.r72MBT9G020153@freeze.ariadne.com","threadId":"34579","inReplyTo":"20130731214818.GP2337@serenity.lan","subject":"Re: Making a patch: \"git format-patch\" does not produce the documented format","fromName":"Dale R. Worley","fromEmail":"worley@alum.mit.edu","sentAt":"2013-08-02T22:11:29Z","receivedAt":"2013-08-02T22:11:29Z","isPatch":false,"sender":{"key":"worley@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/19911107?v=4"},"body":"> From: John Keeping <john@keeping.me.uk>\n> \n> git-format-patch(1) says:\n> \n>         By default, the subject of a single patch is \"[PATCH] \" followed\n>         by the concatenation of lines from the commit message up to the\n>         first blank line (see the DISCUSSION section of git-commit(1)).\n> \n> I think that accurately describes what you're seeing.  The referenced\n> DISCUSSION section describes how to write a commit message that is\n> formatted in a suitable way, with a short first subject line and then a\n> blank line before the body of the message.\n\nThanks for the confirmation.  I've figured out what is going wrong:\nDocumentation/SubmittingPatches says:\n\n    The first line of the commit message should be a short description (50\n    characters is the soft limit, see DISCUSSION in git-commit(1)), and\n    should skip the full stop.\n\nWhat it *doesn't* say is that the second line of the commit message\nshould be empty -- precisely so that git format-patch turns the first\nline into the Subject: but does not merge the remainder of the commit\nmessage (the \"body\") into the Subject: line.  Now that I know to look\nfor this, I can see that the commit messages in the Git repository\nshow this pattern.\n\nI'm preparing some clarifications of SubmittingPatches to explain\nthings that a new person (e.g., me) would not know.  To fix this\nissue, I am inserting:\n\n    This first line should be a separate paragraph, that is, it should be\n    followed by an empty line, which is then followed by the body of the\n    commit message.\n\nDale\n"},{"id":"224474","messageId":"7vzjszoep8.fsf@alter.siamese.dyndns.org","threadId":"34579","inReplyTo":"201308022211.r72MBT9G020153@freeze.ariadne.com","subject":"Re: Making a patch: \"git format-patch\" does not produce the documented format","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-02T23:28:19Z","receivedAt":"2013-08-02T23:28:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"worley@alum.mit.edu (Dale R. Worley) writes:\n\n> I'm preparing some clarifications of SubmittingPatches to explain\n> things that a new person (e.g., me) would not know.\n\nI am not sure if SubmittingPatches is a good place, though.\nThe document is a guidance for people who contribute to _this_\nproject.\n\nBut the specialness of the first paragraph applies to any project\nthat uses Git, so people other than those who contribute to this\nproject should be aware of it.\n\nOriginally we literally used \"first line\", but that made many things\nlike shortlog output and patch Subject: useless when people write a\nblock of text starting from the first line without a title.  Also\nafter resurrecting such a text from e-mail, \"am\" couldn't tell if\nthe \"first line\" on the \"Subject:\" is meant to be the first line of\nthe same first paragraph (which is not what we encourage), or it is\nproperly a single line title, and need a blank line before the first\nline of the body.  So quite a while ago, we changed the rule to take\n\"the first paragraph\" and use that in these places where we want to\ngive a title of a patch.\n"}]}