git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 01/10] Add a birdview-on-the-source-code section to the user manual

From
Jeff King <peff@peff.net>
Date
May 15, 2007, 15:35 UTC
Message-ID
<20070515153513.GA26944@coredump.intra.peff.net>
In-Reply-To
<20070515152457.GC6794@fieldses.org>
On Tue, May 15, 2007 at 11:24:58AM -0400, J. Bruce Fields wrote:
Show 11 quoted lines
> ... Yes.  But actually, the Content-Type header is from
> git-format-patch:
> 
> $ git format-patch --stdout 12806b^..12806b |head
> From 12806b65b0d1faec249002c51b871775dc344a47 Mon Sep 17 00:00:00 2001
> From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> Date: Thu, 10 May 2007 12:36:15 +0200
> Subject: [PATCH] Add a birdview-on-the-source-code section to the user
> manual
> Content-Type: text/plain; charset=utf-8
> Content-Transfer-Encoding: 8bit

Ah, interesting. I had checked that, but my test didn't produce those headers. It seems we only produce them if there are non-ascii characters in the commit message (and I just checked with an arbitrary commit).

So really, this (totally untested) one-liner should fix it:
diff --git a/commit.c b/commit.c
index 922437f..5669c2f 100644
--- a/commit.c
+++ b/commit.c
@@ -1065,6 +1065,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,
 			int sz;
 			char header[512];
 			const char *header_fmt =
+				"MIME-Version: 1.0\n"
 				"Content-Type: text/plain; charset=%s\n"
 				"Content-Transfer-Encoding: 8bit\n";
 			sz = snprintf(header, sizeof(header), header_fmt,


Providing that nobody objects to sticking that extra header in
format-patch's output (but of course only when we actually have
non-ascii data). It's technically required if we want the output to be a
valid MIME message, but most things are unlikely to care (except vger's
apparently picky MTA).

-Peff
Previous: J. Bruce FieldsNext: Junio C Hamano
Message 15 of 17 in “Re: [PATCH 01/10] Add a birdview-on-the-source-code section to the user manual”
  1. Karl HasselströmMay 14, 2007
  2. J. Bruce FieldsMay 14, 2007
  3. Matthieu MoyMay 14, 2007
  4. Karl HasselströmMay 14, 2007
  5. J. Bruce FieldsMay 15, 2007
  6. Jeff KingMay 15, 2007
  7. Jeffrey C. OllieMay 15, 2007
  8. Jeff KingMay 15, 2007
  9. Karl HasselströmMay 15, 2007
  10. Junio C HamanoMay 15, 2007
  11. Jeff KingMay 15, 2007
  12. Junio C HamanoMay 15, 2007
  13. Jeff KingMay 16, 2007
  14. J. Bruce FieldsMay 15, 2007
  15. Jeff KingMay 15, 2007
  16. Junio C HamanoMay 15, 2007
  17. Jeff KingMay 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.