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

Re: git format-patch doesn't add Content-type for UTF-8 diffs

From
Paul Eggert <eggert@cs.ucla.edu>
Date
Jun 30, 2014, 18:54 UTC
Message-ID
<53B1B24B.2040609@cs.ucla.edu>
In-Reply-To
<20140630173052.GB16747@sigill.intra.peff.net>
Jeff King wrote:
> How do you send the mails after they come out of format-patch?
I run a shell command like this (on Solaris 10):

/usr/lib/sendmail -ONoRecipientAction=add-to tz@iana.org < 0001-whatever.patch

(The "NoRecipientAction" option pacifies the IANA MTA.)
This is an old machine not under my control, with an old 'git' installed 
that I don't use and don't particularly want to worry about porting to. 
  I generate the patch file on a different machine with git 1.9.3, and 
scp it into the email-sending machine.
I suppose that I could work around the problem with this shell command:
(grep -q '^Mime-Version: ' 0001-whatever.patch ||
    printf '%s\n' \
      'MIME-Version: 1.0' \
      'Content-Type: text/plain; charset=UTF-8' \
      'Content-Transfer-Encoding: 8bit'
  cat 0001-whatever.patch) |
/usr/lib/sendmail -ONoRecipientAction=add-to tz@iana.org
but that's less convenient.
> I wonder if it would be enough to do:
>
>   1. Always add a content-type header, even if the commit is utf-8 and
>      contains only ascii characters.

That would help for my case, yes. We use only UTF-8, and to me it feelds weird that patches are mailed properly if the commit log contains non-ASCII characters, but don't work if the commit log is ASCII and the diff contains non-ASCII.

Previous: Jeff KingNext: Torsten Bögershausen
Message 3 of 4 in “git format-patch doesn't add Content-type for UTF-8 diffs”
  1. Paul EggertJun 30, 2014
  2. Jeff KingJun 30, 2014
  3. Paul EggertJun 30, 2014
  4. Torsten BögershausenJul 1, 2014

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.