git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carl Worth <cworth@cworth.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] format-patch: Properly escape From_ lines when creating an mbox.
Date: Thu, 10 Jun 2010 08:31:05 -0700	[thread overview]
Message-ID: <87pqzyhpl2.fsf@yoom.home.cworth.org> (raw)
In-Reply-To: <7vaar3nds1.fsf@alter.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 2995 bytes --]

On Thu, 10 Jun 2010 07:49:34 -0700, Junio C Hamano <gitster@pobox.com> wrote:
> Carl Worth <cworth@cworth.org> writes:
> Please disregard the above; I wasn't thinking straight.

No worries.

> If your format-patch quotes ">*From " in the log message, and you unquote
> it somewhere in mailsplit to mailinfo pipeline, then the only time any
> funny interaction between the current git and your git would happen is
> when your git formats a commit with a line in its log that begins with
> "From " that cannot be a mistaken as a UNIX-From line and you use "am"
> from the current git on the output; the resulting commit would get an
> extra ">" left in the message, but that is a small price to pay.

Correct. That's the only downside I see. And it's clearly not a huge
price. Checking the entire git.git history, I found only 12 messages
that have a line beginning with "From " in the commit message, (ignoring
the 5 I referred to earlier where the mbox line actually ended up in the
commit message). Of these, three already have a ">From" in them.

So clearly this kind of thing is happening already. People are sometimes
using systems that quote these lines and git isn't un-quoting. But it's
really not that objectionable in the end.

> There is
> no other downside I can see (and the upside is that the output from your
> format-patch won't be split incorrectly, of course).

Good. And this series does fix actual bugs like the failure to rebase
across a message with a "From ... <timestamp>" line as mentioned before.

> I find that the change to format-patch not to emit the UNIX-From line when
> generating one file per commit is somewhat iffy.  An upside is that the
> existing mailsplit-mailinfo pipeline already knows not to split such an
> input, so the change makes

This patch was written to reduce the likelihood of the downside
mentioned above. But I understand the potential costs you outlined.
I'll let you make the call on whether to include it. The rest of the
patch series will work fine without this one. But leaving it out will
lead to more occurrences of undesired ">From " in commit messages, (even
with new "git am" as send-email or some other MUA will see the quoted
">From " and treat it as the intended payload, not an escaped "From ").

> It is nice at the conceptual level, though.  By declaring individual file
> RFC2822 message (not mbox), it makes it very clear that it is MUA's
> responsibility to quote "From " in the payload when the output is used by
> MUA to compose and send a message.  IOW, we shouldn't be doing the quote
> in our output when operating in that mode.

I suppose we could maintain compatibility with any scripts, etc. by
still emitting the initial "From " line, but declaring these files as
messages (not mbox) and avoiding doing any quoting for them.

I think that gets us all the upsides with no downsides. I'll send one
last patch for that.

-Carl

-- 
carl.d.worth@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2010-06-10 15:31 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 [this message]
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
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=87pqzyhpl2.fsf@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hpa@zytor.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 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).