git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: git@vger.kernel.org
Subject: Re: git-am: "Patch fragment without a header"
Date: Mon, 06 Feb 2006 21:35:25 -0800	[thread overview]
Message-ID: <7vfymv3f4y.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <43E814C2.6090104@zytor.com> (H. Peter Anvin's message of "Mon, 06 Feb 2006 19:32:18 -0800")

"H. Peter Anvin" <hpa@zytor.com> writes:

> Unfortunately git-mailinfo is in C, otherwise I'd have suggested using
> the Perl MIME-tools, which seems to have all this stuff in it.

Heh, spawn Perl for every message?  I'd be ****ed by Linus if I
did so ;-).

This should fix it and I'd appreciate if you try it on other
messages.

I tried it on the message you quoted with:

    git-mailinfo -u /var/tmp/msg /var/tmp/patch <./+hpa.eml >/var/tmp/info

The resulting 'msg' and 'info' looks reasonable utf8 and patch
was not corrupt.

-- >8 --
[PATCH] mailinfo: reset CTE after each multipart

If the first part uses quoted-printable to protect iso8859-1
name in the commit log, and the second part was plain ascii text
patchfile without even Content-Transfer-Encoding subheader, we
incorrectly tried to decode the patch as quoted printable.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/mailinfo.c b/mailinfo.c
index 0265a29..ff2d4d4 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -707,6 +707,9 @@ static void handle_multipart_body(void)
 		if (!len) {
 			if (handle_multipart_one_part() < 0)
 				return;
+			/* Reset per part headers */
+			transfer_encoding = TE_DONTCARE;
+			charset[0] = 0;
 		}
 		else
 			check_subheader_line(line, len);

  reply	other threads:[~2006-02-07  5:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-07  2:59 git-am: "Patch fragment without a header" H. Peter Anvin
2006-02-07  3:20 ` Junio C Hamano
2006-02-07  3:32   ` H. Peter Anvin
2006-02-07  5:35     ` Junio C Hamano [this message]
2006-02-07 15:46     ` Linus Torvalds

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=7vfymv3f4y.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --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.
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).