git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add MIME information to outgoing email
@ 2008-03-13 16:40 Samuel Tardieu
  2008-03-13 17:00 ` Jeff King
  2008-03-13 18:48 ` Junio C Hamano
  0 siblings, 2 replies; 25+ messages in thread
From: Samuel Tardieu @ 2008-03-13 16:40 UTC (permalink / raw)
  To: git; +Cc: Samuel Tardieu

Add MIME-Version/Content-Type/Content-Transfer-Encoding headers in
messages generated with git-format-patch. Without it, messages generated
without using --attach or --inline didn't have any content type information.

I got hit with this problem yesterday when sending a patch to linux-kernel
with a commit message containing the name "Pádraig" in it. Moreover,
the mailing-list software added an incorrect ISO-8859-1 encoding information
which mangled Pádraig's name.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 log-tree.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 608f697..0dacf63 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -198,7 +198,16 @@ void log_write_email_headers(struct rev_info *opt, const char *name,
 			 opt->no_inline ? "attachment" : "inline",
 			 name);
 		opt->diffopt.stat_sep = buffer;
-	}
+	} else {
+		static char buffer[1024];
+		snprintf(buffer, sizeof(buffer) - 1,
+			 "%s"
+			 "MIME-Version: 1.0\n"
+			 "Content-Type: text/plain; charset=UTF-8; format=fixed\n"
+			 "Content-Transfer-Encoding: 8bit\n",
+			 extra_headers ? extra_headers : "");
+		extra_headers = buffer;
+	};
 	*subject_p = subject;
 	*extra_headers_p = extra_headers;
 }
-- 
1.5.4.4.653.g7cf1e.dirty

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2008-04-10 18:48 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-13 16:40 [PATCH] Add MIME information to outgoing email Samuel Tardieu
2008-03-13 17:00 ` Jeff King
2008-03-13 17:14   ` Samuel Tardieu
2008-03-14 13:29     ` Jeff King
2008-03-14 13:40       ` Samuel Tardieu
2008-03-14 13:46         ` Jeff King
2008-03-14 13:50           ` Samuel Tardieu
2008-03-14 14:35             ` Jeff King
2008-03-14 14:40               ` Samuel Tardieu
2008-03-14 16:20   ` Junio C Hamano
2008-03-14 20:21     ` Re* " Junio C Hamano
2008-03-14 21:27       ` Jeff King
2008-03-13 18:48 ` Junio C Hamano
2008-03-13 19:05   ` Samuel Tardieu
2008-03-14 11:21     ` Brian Swetland
2008-03-14 11:57       ` Samuel Tardieu
2008-03-25 18:31   ` MIME headers in introductory message (git send-email --compose) Teemu Likonen
2008-03-25 19:17     ` Jay Soffian
2008-03-25 20:47       ` Junio C Hamano
2008-03-25 20:59         ` Jay Soffian
2008-03-25 21:56         ` Jeff King
2008-03-25 22:07           ` Jeff King
2008-03-25 23:06     ` Jeff King
2008-03-26  2:46       ` Jay Soffian
2008-04-10 18:47       ` Jan Hudec

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).