]> git.ipfire.org Git - thirdparty/git.git/commit
send-email: default to quoted-printable when CR is present
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 13 Apr 2019 22:45:51 +0000 (22:45 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 14 Apr 2019 02:47:03 +0000 (11:47 +0900)
commit74d76a17013411d72ebda7c230b9898f3adb1fcc
treef4d337dc9f436de9fb381f002c103181e65fd65a
parentaeb582a98374c094361cba1bd756dc6307432c42
send-email: default to quoted-printable when CR is present

In 7a36987fff ("send-email: add an auto option for transfer encoding",
2018-07-08), git send-email learned how to automatically determine the
transfer encoding for a patch. However, the only criterion considered
was the length of the lines.

Another case we need to consider is that of carriage returns. Because
emails have CRLF endings when canonicalized, we don't want to write raw
carriage returns into a patch, lest they be stripped off as an artifact
of the transport. Ensure that we choose quoted-printable encoding if the
patch we're sending contains carriage returns.

Note that we are guaranteed to always correctly encode carriage returns
when writing quoted-printable since we explicitly specify the line
ending as "\n", forcing MIME::QuotedPrint to encode our carriage return
as "=0D".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl
t/t9001-send-email.sh