From: Junio C Hamano <gitster@pobox•com>
To: Chris Packham <judge.packham@gmail•com>
Cc: GIT <git@vger•kernel.org>
Subject: Re: [bug (maybe)] Applying patch with '---'
Date: Tue, 31 Mar 2015 23:20:25 -0700 [thread overview]
Message-ID: <xmqqy4mcmkt2.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAFOYHZC6Qd9wkoWPcTJDxAs9u=FGpHQTkjE-guhwkya0DRVA6g@mail.gmail.com> (Chris Packham's message of "Wed, 1 Apr 2015 15:37:01 +1300")
Chris Packham <judge.packham@gmail•com> writes:
> So I was just sent a patch generated with 'git format-patch' that 'git
> am' fails to apply correctly. It applies but part of the commit
> message is lost.
>
> The problem is that the commit message has lines like
>
> --- Foo happened
> did some things to handle Foo
> --- Bar happened
> Still processing update from Foo which led to a crash
>
> git mailinfo seems to discard everything after the first '--- Blah'.
Yes, this is well known. So is a line that begins with "diff --git"
makes mailinfo to guess that it is the end of the log message.
> ... I know git
> mailinfo shouldn't handle garbage input but I guess the problem I have
> is that the patch was generated by git format-patch ...
Whatever message you write format-patch emits without escaping, so
"patch was generated by format-patch" does not guarantee anything,
unfortunately. A related similar issue is that a line that begins
with "From " may be corrupted into a line that begins with ">From "
by the time the message hits your mailbox. These are unfortunately
something you have to know and long-time users learned to avoid
doing so unconsciously ;-).
next prev parent reply other threads:[~2015-04-01 6:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-01 2:37 [bug (maybe)] Applying patch with '---' Chris Packham
2015-04-01 6:20 ` Junio C Hamano [this message]
2015-04-01 8:06 ` Chris Packham
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=xmqqy4mcmkt2.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=judge.packham@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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