From: Jeff King <peff@peff.net>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] sequencer: support folding in rfc2822 footer
Date: Wed, 7 Sep 2016 02:38:19 -0400 [thread overview]
Message-ID: <20160907063819.dd7aulnlsytcuyqj@sigill.intra.peff.net> (raw)
In-Reply-To: <fbdda11c-c53e-f9fc-8b3a-934810215c5f@google.com>
On Tue, Sep 06, 2016 at 04:30:24PM -0700, Jonathan Tan wrote:
> On 09/06/2016 03:08 PM, Jonathan Tan wrote:
> > On 09/02/2016 07:23 PM, Junio C Hamano wrote:
> > > A slightly related tangent. An unconditionally good change you
> > > could make is to allow folding of in-body headers. I.e. you can
> > > have e.g.
> > >
> > > -- >8 --
> > > Subject: [PATCH] sequencer: support in-body headers that are
> > > folded according to RFC2822 rules
> > >
> > > The first paragraph after the above long title begins
> > > here...
> > >
> > > in the body of the msssage, and I _think_ we do not fold it properly
> > > when applying such a patch. We should, as that is something that
> > > appears in format-patch output (i.e. something Git itself produces,
> > > unlike the folded "footer").
> >
> > OK, I'll take a look at this.
>
> It turns out that Git seems to already do this, at least for Subject.
Right, because "Subject" is actually a real RFC 2822 header in the
generated email message. Not only do we expect things like mail readers
to handle this, but we _have_ to wrap at a certain point to meet the
standard[1].
I don't think any part of Git ever shunts "Subject" to an in-body
header, though I'd guess people do it manually all the time.
> $ git format-patch HEAD^
> 0001-this-is-a-very-long-subject-to-test-line-wrapping-th.patch
> $ cat 0001-this-is-a-very-long-subject-to-test-line-wrapping-th.patch
> <snip>
> Subject: [PATCH] this is a very long subject to test line wrapping this is a
> very long subject to test line wrapping
> <snip>
So the interesting bit is what happens with:
git checkout master^
git am 0001-*
and with:
perl -lpe '
# Bump subject down to in-body header.
if (/^Subject:/) {
print "Subject: real subject";
print "";
}
' 0001-* >patch
git checkout master^
git am patch
It looks like we get the first one right, but not the second.
-Peff
[1] A careful reader may note that arbitrarily-long body lines,
including in-body headers and footers, may _also_ run afoul of
the body line-length limits. The "right" solution there is
probably quoted-printable, but it's ugly enough that I wouldn't do
so unless we see a real-world case where the line lengths are a
problem.
next prev parent reply other threads:[~2016-09-07 6:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 19:58 [PATCH] sequencer: support folding in rfc2822 footer Jonathan Tan
2016-09-03 2:23 ` Junio C Hamano
2016-09-06 22:08 ` Jonathan Tan
2016-09-06 23:30 ` Jonathan Tan
2016-09-07 6:38 ` Jeff King [this message]
2016-09-16 17:37 ` [RFC/PATCH 0/3] handle multiline in-body headers Jonathan Tan
2016-09-16 18:29 ` Junio C Hamano
2016-09-16 17:37 ` [RFC/PATCH 1/3] mailinfo: refactor commit message processing Jonathan Tan
2016-09-16 19:12 ` Junio C Hamano
2016-09-16 21:46 ` Jeff King
2016-09-16 17:37 ` [RFC/PATCH 2/3] mailinfo: correct malformed test example Jonathan Tan
2016-09-16 19:19 ` Junio C Hamano
2016-09-16 22:42 ` Jonathan Tan
2016-09-16 22:55 ` Junio C Hamano
2016-09-17 0:31 ` Jonathan Tan
2016-09-17 3:48 ` Junio C Hamano
2016-09-16 17:37 ` [RFC/PATCH 3/3] mailinfo: handle in-body header continuations Jonathan Tan
2016-09-16 20:17 ` Junio C Hamano
2016-09-16 20:49 ` Jonathan Tan
2016-09-16 20:59 ` Junio C Hamano
2016-09-16 22:36 ` Jonathan Tan
2016-09-16 23:04 ` Junio C Hamano
2016-09-17 0:22 ` Jonathan Tan
2016-09-16 21:51 ` Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160907063819.dd7aulnlsytcuyqj@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@google.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).