From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jim Meyering <jim@meyering.net>,
Drew Northup <drew.northup@maine.edu>,
git list <git@vger.kernel.org>, Yann Dirson <ydirson@altern.org>,
Stephen Boyd <bebarino@gmail.com>
Subject: [PATCH 2/5] Documentation: explain how to check for patch corruption
Date: Thu, 14 Apr 2011 21:24:01 -0500 [thread overview]
Message-ID: <20110415022401.GC19829@elie> (raw)
In-Reply-To: <20110415021100.GA19829@elie>
SubmittingPatches has some excellent advice about how to check a patch
for corruption before sending it off. Move it to the format-patch
manual so it can be installed with git's documentation for use by
people not necessarily interested in the git project's practices.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Documentation/SubmittingPatches | 58 ++++++++---------------------------
Documentation/git-format-patch.txt | 46 ++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 44 deletions(-)
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index c6a5032..20b4101 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -344,50 +344,20 @@ MUA specific hints
Some of patches I receive or pick up from the list share common
patterns of breakage. Please make sure your MUA is set up
-properly not to corrupt whitespaces. Here are two common ones
-I have seen:
-
-* Empty context lines that do not have _any_ whitespace.
-
-* Non empty context lines that have one extra whitespace at the
- beginning.
-
-One test you could do yourself if your MUA is set up correctly is:
-
-* Send the patch to yourself, exactly the way you would, except
- To: and Cc: lines, which would not contain the list and
- maintainer address.
-
-* Save that patch to a file in UNIX mailbox format. Call it say
- a.patch.
-
-* Try to apply to the tip of the "master" branch from the
- git.git public repository:
-
- $ git fetch http://kernel.org/pub/scm/git/git.git master:test-apply
- $ git checkout test-apply
- $ git reset --hard
- $ git am a.patch
-
-If it does not apply correctly, there can be various reasons.
-
-* Your patch itself does not apply cleanly. That is _bad_ but
- does not have much to do with your MUA. Please rebase the
- patch appropriately.
-
-* Your MUA corrupted your patch; "am" would complain that
- the patch does not apply. Look at .git/rebase-apply/ subdirectory and
- see what 'patch' file contains and check for the common
- corruption patterns mentioned above.
-
-* While you are at it, check what are in 'info' and
- 'final-commit' files as well. If what is in 'final-commit' is
- not exactly what you would want to see in the commit log
- message, it is very likely that your maintainer would end up
- hand editing the log message when he applies your patch.
- Things like "Hi, this is my first patch.\n", if you really
- want to put in the patch e-mail, should come after the
- three-dash line that signals the end of the commit message.
+properly not to corrupt whitespaces.
+
+See the DISCUSSION section of git-format-patch(1) for hints on
+checking your patch by mailing it to yourself and applying with
+git-am(1).
+
+While you are at it, check the resulting commit log message from
+a trial run of applying the patch. If what is in the resulting
+commit is not exactly what you would want to see, it is very
+likely that your maintainer would end up hand editing the log
+message when he applies your patch. Things like "Hi, this is my
+first patch.\n", if you really want to put in the patch e-mail,
+should come after the three-dash line that signals the end of the
+commit message.
Pine
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index a4a9813..5c60418 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -286,6 +286,52 @@ title is likely to be different from the subject of the discussion the
patch is in response to, so it is likely that you would want to keep
the Subject: line, like the example above.
+Checking for patch corruption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Many mailers if not set up properly will corrupt whitespace. Here are
+two common types of corruption:
+
+* Empty context lines that do not have _any_ whitespace.
+
+* Non-empty context lines that have one extra whitespace at the
+ beginning.
+
+One way to test if your MUA is set up correctly is:
+
+* Send the patch to yourself, exactly the way you would, except
+ with To: and Cc: lines that do not contain the list and
+ maintainer address.
+
+* Save that patch to a file in UNIX mailbox format. Call it a.patch,
+ say.
+
+* Apply it:
+
+ $ git fetch <project> master:test-apply
+ $ git checkout test-apply
+ $ git reset --hard
+ $ git am a.patch
+
+If it does not apply correctly, there can be various reasons.
+
+* The patch itself does not apply cleanly. That is _bad_ but
+ does not have much to do with your MUA. You might want to rebase
+ the patch with linkgit:git-rebase[1] before regenerating it in
+ this case.
+
+* The MUA corrupted your patch; "am" would complain that
+ the patch does not apply. Look in the .git/rebase-apply/ subdirectory and
+ see what 'patch' file contains and check for the common
+ corruption patterns mentioned above.
+
+* While at it, check the 'info' and 'final-commit' files as well.
+ If what is in 'final-commit' is not exactly what you would want to
+ see in the commit log message, it is very likely that the
+ receiver would end up hand editing the log message when applying
+ your patch. Things like "Hi, this is my first patch.\n" in the
+ patch e-mail should come after the three-dash line that signals
+ the end of the commit message.
+
EXAMPLES
--------
--
1.7.5.rc0
next prev parent reply other threads:[~2011-04-15 2:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 15:39 [PATCH] remove doubled words, e.g., s/to to/to/, and fix related typos Jim Meyering
2011-04-13 18:35 ` Drew Northup
2011-04-13 21:22 ` Jim Meyering
2011-04-13 22:17 ` [PATCH/RFC] Documentation/format-patch: summarize patch-sending workflow Jonathan Nieder
2011-04-13 22:38 ` Junio C Hamano
2011-04-14 21:11 ` [PATCH v2] Documentation: summarize how format-patch output is consumed Jonathan Nieder
2011-04-14 22:05 ` Junio C Hamano
2011-04-15 2:11 ` [PATCH/RFC v3 0/5] Documentation/format-patch: more hints on submitting patches Jonathan Nieder
2011-04-15 2:22 ` [PATCH 1/5] Documentation: describe the format of messages with inline patches Jonathan Nieder
2011-04-15 20:11 ` Drew Northup
2011-04-15 20:24 ` Junio C Hamano
2011-04-15 2:24 ` Jonathan Nieder [this message]
2011-04-15 4:53 ` [PATCH 2/5] Documentation: explain how to check for patch corruption Junio C Hamano
2011-04-15 6:17 ` Jonathan Nieder
2011-04-15 2:28 ` [PATCH 3/5] Documentation: hints for sending patches inline with Thunderbird Jonathan Nieder
2011-04-15 2:32 ` [PATCH 4/5] Documentation: publicize KMail hints for sending patches inline Jonathan Nieder
2011-04-17 13:57 ` Michele Ballabio
2011-04-15 2:33 ` [PATCH 5/5] Documentation: publicize hints for sending patches with GMail Jonathan Nieder
2011-04-15 7:41 ` [PATCH/RFC 6/5] Documentation/format-patch: suggest Toggle Word Wrap add-on for Thunderbird Johannes Sixt
2011-04-15 17:54 ` Junio C Hamano
2011-04-15 18:01 ` Michael J Gruber
2011-04-15 18:49 ` Junio C Hamano
2011-04-15 20:17 ` Jonathan Nieder
2011-04-18 6:31 ` [PATCH 6/5 v2] " Johannes Sixt
2011-04-13 22:26 ` [PATCH] remove doubled words, e.g., s/to to/to/, and fix related typos Jakub Narebski
2011-04-13 18:47 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110415022401.GC19829@elie \
--to=jrnieder@gmail.com \
--cc=bebarino@gmail.com \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jim@meyering.net \
--cc=ydirson@altern.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).