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

Re: [PATCH 2/3] send-email: accept long lines with suitable transfer encoding

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 6, 2018, 06:08 UTC
Message-ID
<CAPig+cTNGNCUxoBdunAvjAKy5w_oYaLJ7HiAp1vYCtPmDEOUww@mail.gmail.com>
In-Reply-To
<20180706022357.739657-3-sandals@crustytoothpaste.net>

On Thu, Jul 5, 2018 at 10:24 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 16 quoted lines
> With --validate (which is the default), we warn about lines exceeding
> 998 characters due to the limits specified in RFC 5321.  However, if
> we're using a suitable transfer encoding (quoted-printable or base64),
> we're guaranteed not to have lines exceeding 76 characters, so there's
> no need to fail in this case.  The auto transfer encoding handles this
> specific case, so accept it as well.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
> @@ -401,8 +401,9 @@ have been specified, in which case default to 'compose'.
> -               *       Warn of patches that contain lines longer than 998 characters; this
> -                       is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
> +               *       Warn of patches that contain lines longer than 998 characters unless
> +                       a suitable transfer encoding is used; this is due to SMTP limits as
> +                       described by http://www.ietf.org/rfc/rfc2821.txt.

A reader might like to know what "a suitable transfer encoding" is. Perhaps add a "such as 'auto', 'quoted-printable' and 'base64'" comment?

Show 14 quoted lines
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> @@ -480,6 +480,19 @@ test_expect_success $PREREQ 'long lines with auto encoding are quoted-printable'
> +test_expect_success $PREREQ '--validate passes with certain encodings' '
> +       for enc in auto quoted-printable base64
> +       do
> +               git send-email \
> +                       --from="Example <nobody@example.com>" \
> +                       --to=nobody@example.com \
> +                       --smtp-server="$(pwd)/fake.sendmail" \
> +                       --transfer-encoding=$enc \
> +                       --validate \
> +                       $patches longline.patch
> +       done
> +'

If you turn this inside out, it will be easier to figure out which encoding fails (if one ever does). That is:

    for enc in auto quoted-printable base64
    do
        test_expect_success $PREREQ "--validate passes with encoding $enc" '
            git send-email ...
        '
    done
Previous: brian m. carlsonNext: Drew DeVault
Message 7 of 16 in “Automatic transfer encoding for patches”
  1. 0/3 Automatic transfer encoding for patchesbrian m. carlson, Jul 6, 2018
  2. 1/3 send-email: add an auto option for transfer encodingbrian m. carlson, Jul 6, 2018
  3. Eric SunshineJul 6, 2018
  4. brian m. carlsonJul 6, 2018
  5. 3/3 send-email: automatically determine transfer-encodingbrian m. carlson, Jul 6, 2018
  6. 2/3 send-email: accept long lines with suitable transfer encodingbrian m. carlson, Jul 6, 2018
  7. Eric SunshineJul 6, 2018
  8. Drew DeVaultJul 6, 2018
  9. brian m. carlsonJul 6, 2018
  10. Drew DeVaultJul 6, 2018
  11. 0/4 Automatic transfer encoding for patchesbrian m. carlson, Jul 8, 2018
  12. 1/4 send-email: add an auto option for transfer encodingbrian m. carlson, Jul 8, 2018
  13. 2/4 send-email: accept long lines with suitable transfer encodingbrian m. carlson, Jul 8, 2018
  14. 4/4 docs: correct RFC specifying email line lengthbrian m. carlson, Jul 8, 2018
  15. 3/4 send-email: automatically determine transfer-encodingbrian m. carlson, Jul 8, 2018
  16. Drew DeVaultJul 8, 2018

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.