From: "H. Peter Anvin" <hpa@zytor.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Carl Worth <cworth@cworth.org>, git <git@vger.kernel.org>
Subject: Re: [PATCH] format-patch: Properly escape From_ lines when creating an mbox.
Date: Tue, 08 Jun 2010 22:48:44 -0700 [thread overview]
Message-ID: <4C0F2B3C.4060203@zytor.com> (raw)
In-Reply-To: <7vljaorhjq.fsf@alter.siamese.dyndns.org>
On 06/08/2010 08:50 PM, Junio C Hamano wrote:
> Carl Worth <cworth@cworth.org> writes:
>
>> Without this patch series, there's no documented way that an external
>> tool can use to reliably construct an mbox that will be correctly handled
>> by "git am". The best one could do is to peek inside the git implementation
>> and notice that it wants unescaped "From " lines, that it will ignore any
>> "From " line that doesn't end with something very much like asctime format,
>> and then somehow ensure that no messages in the mbox have lines that begin
>> with "From " and end with something like asctime format, (which won't be
>> possible in all cases without corrupting the message).
>
> I have this small suspicion that mboxrd may be a suboptimal choice, when
> you consider how robustly we can notice a failure (and to a lessor extent,
> recover from it) when using output from "format-patch --stdout" to
> sneakernet between existing and updated versions of git. Especially
> because your implementation quotes lines that begin with "From "
> unconditionally (even when the tail end of the line would never be a
> valid-looking timestamp). Such an output will confuse existing mailsplit,
> but the worst part of the story is that somebody who is applying a series
> of patches will _not_ notice the breakage. The payload of the second and
> subsequent messages will likely be concatenated as if it were part of the
> first message, ignoring cruft between patches, but the resulting tree
> would likely to be the same as what the sending end intended.
>
> Compared to that, I think a failure to split a message in the middle (iow,
> commit message happened to have a line that begins with "From " and ends
> with a timestamp-looking string) is much easier to notice (because the
> first part of the message that was incorrectly split at such a line will
> not have any patch, so "git am" will stop). IOW, failure to split is
> easier to notice than splitting too eagerly.
>
> Perhaps perfect is an enemy of good?
For production perhaps we should do the MIME-escape thing?
For consumption, it's not so clear...
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
next prev parent reply other threads:[~2010-06-09 5:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 1:01 [PATCH] format-patch: Properly escape From_ lines when creating an mbox Carl Worth
2010-06-09 3:50 ` Junio C Hamano
2010-06-09 5:14 ` Carl Worth
2010-06-09 16:56 ` Carl Worth
2010-06-10 14:49 ` Junio C Hamano
2010-06-10 15:31 ` Carl Worth
2010-06-10 15:52 ` Carl Worth
2010-06-10 16:12 ` Junio C Hamano
2010-06-10 16:30 ` Carl Worth
2010-06-09 5:48 ` H. Peter Anvin [this message]
2010-06-09 7:04 ` Carl Worth
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=4C0F2B3C.4060203@zytor.com \
--to=hpa@zytor.com \
--cc=cworth@cworth.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.