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

Re: commit a1f6baa5 (wrap long header lines) breaks my habit

From
SHStefan-W. Hahn <stefan.hahn@s-hahn.de>
Date
May 25, 2011, 15:40 UTC
Message-ID
<20110525154046.GC7723@scotty.home>
In-Reply-To
<20110524200716.GF584@sigill.intra.peff.net>
Mail von Jeff King, Tue, 24 May 2011 at 16:07:16 -0400:
Hello,
Show 6 quoted lines
> > > >    git format-patch -k --stdout a..b | git am -k -3
> > > 
> > > Why -k to am?
> > 
> > Just first "-k", and "git am -3". Wrong in mind here at home before my
> > computer.

Wrong. I really typed the second "-k". (Local intelligence in fingers.)

Show 6 quoted lines
> Then it should preserve your long subject line just fine, as mailsplit
> (called by "am") will reassemble the folded line according to rfc822
> header folding rules.
> 
> With "am -k", it does keep the fold. This is an artifact of the original
> behavior, where the folds were literally included from a multi-line
Correct, I checked this, so with
   git format-patch -k --stdout a..b | git am -3
(no second -k)
all is as before. 
Thanks for your clarification, sorry for the noise.
Stefan
Perhaps a little clarification like this:
commit e8069848dffe72579aa7f2c542e39fde9eab84b1
Author: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
Date:   Wed May 25 17:33:03 2011 +0200
    format-patch: Clarify the behaviour of '-k'.
    
    Added clarification in documentation of of 'git format-patch'.
    
    When using 'git format-patch' together with 'git am' for rebasing,
    'git am' should be called without '-k' if long subject lines should be
    reassembled. This is neccesary, because a wrapping of long header lines
    was introduced with commit:
    
    commit a1f6baa5c97abc8b579fa7ac7c4dc21971bdc048
    format-patch: wrap long header lines
    
    Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index d13c9b2..4e62248 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -468,6 +468,16 @@ the current branch using 'git am' to cherry-pick them:
 ------------
 $ git format-patch -k --stdout R1..R2 | git am -3 -k
 ------------
++
+In this example the subject lines of the commits will be folded after
+78 characters and 'git am' will keep this folding.
++
+To preserve long subject lines, 'git am' will reassemble the folded
+lines according to rfc822 if called without '-k' like this:
++
+------------
+$ git format-patch -k --stdout R1..R2 | git am -3
+------------
 
 * Extract all commits which are in the current branch but not in the
 origin branch:
-- 
Stefan-W. Hahn                          It is easy to make things.
                                        It is hard to make things simple.
Previous: Jeff KingNext: Jeff King
Message 5 of 16 in “commit a1f6baa5 (wrap long header lines) breaks my habit”
  1. Stefan-W. HahnMay 24, 2011
  2. Junio C HamanoMay 24, 2011
  3. Stefan-W. HahnMay 24, 2011
  4. Jeff KingMay 24, 2011
  5. Stefan-W. HahnMay 25, 2011
  6. Jeff KingMay 26, 2011
  7. 1/3 t: test subject handling in format-patch / am pipelineJeff King, May 26, 2011
  8. 2/3 mailinfo: always clean up rfc822 header foldingJeff King, May 26, 2011
  9. 3/3 format-patch: preserve subject newlines with -kJeff King, May 26, 2011
  10. Junio C HamanoMay 26, 2011
  11. Jeff KingMay 26, 2011
  12. Jeff KingMay 26, 2011
  13. 3/5 pretty: add pp_commit_easy function for simple callersJeff King, May 26, 2011
  14. Junio C HamanoMay 26, 2011
  15. 4/5 clean up calling conventions for pretty.c functionsJeff King, May 26, 2011
  16. 5/5 format-patch: preserve subject newlines with -kJeff King, May 26, 2011

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.