Skip to content
  • brian m. carlson's avatar
    send-email: default to quoted-printable when CR is present · 74d76a17
    brian m. carlson authored and Junio C Hamano's avatar Junio C Hamano committed
    In 7a36987f
    
     ("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: default avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    74d76a17