git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: Is git am supposed to decode MIME?
Date: Thu, 12 Oct 2017 15:20:19 +0200	[thread overview]
Message-ID: <39aebcbd-7820-eafe-3c44-b96b057d0059@redhat.com> (raw)
In-Reply-To: <20171004092546.vnjddxqwvia5cfn6@sigill.intra.peff.net>

On 10/04/2017 11:25 AM, Jeff King wrote:
> On Wed, Oct 04, 2017 at 10:44:31AM +0200, Florian Weimer wrote:
> 
>> The git am documentation talks about “mailboxes”.  I suppose these contain
>> messages in Internet Mail syntax.  Is git am supposed to decode MIME?
>>
>> I'm asking because I have a message whose body is encoded as
>> quoted-printable, but git am does not parse the patch contained in it.
>>
>> If git am is supposed to deal with this, I'll dig deeper and try to figure
>> out where things go wrong.
> 
> Yes, it should. I just double-checked with the toy patch patch below,
> and it correctly extracted the quoted-printable from the commit message
> and patch, as well as in the headers.

It took me a while, but I know think the message is simply corrupted. 
It's encoded with quoted-printable, and that looks correct, but it ends 
with:

@@ -5137,11 +5114,13 @@ __libc_mallopt (int param_number, int value)
    if (__malloc_initialized < 0)
      ptmalloc_init ();
    __libc_lock_lock (av->mutex);
-  /* Ensure initialization/consolidation */
-  malloc_consolidate (av);
=20
    LIBC_PROBE (memory_mallopt, 2, param_number, value);
=20
+  /* We must consolidate main arena before changing max_fast
+     (see definition of set_max_fast).  */
+  malloc_consolidate (av);
+
    switch (param_number)
      {
      case M_MXFAST:=

The “=” masks the final newline, and that doesn't decode into a valid 
diff hunk.  The file being patched continues after that, so it's not 
even the “\ No newline at end of file” case.

So in short, there is no Git bug here, and I just failed to interpret 
the “git am” diagnostics correctly:

Applying: Improve malloc initialization sequence
error: corrupt patch at line 342
Patch failed at 0001 Improve malloc initialization sequence
The copy of the patch that failed is found in: .git/rebase-apply/patch

Line 342 refers to the file in .git/rebase-apply/patch, not the original 
input, and it took me a while to figure that out.

Thanks,
Florian

  reply	other threads:[~2017-10-12 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04  8:44 Is git am supposed to decode MIME? Florian Weimer
2017-10-04  9:25 ` Jeff King
2017-10-12 13:20   ` Florian Weimer [this message]
2017-10-04 10:10 ` Junio C Hamano

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=39aebcbd-7820-eafe-3c44-b96b057d0059@redhat.com \
    --to=fweimer@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).