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