Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--) are properly identified

From: Robert Pluim <[email-masked]>
Date: Fri, 12 Jul 2024 10:28:41 +0200

>>>>> On Fri, 12 Jul 2024 09:51:16 +0300, Juri Linkov <[email-masked]> said:

    >> +(with-eval-after-load 'mm-uu
    >> +  (setf (nth 1 (alist-get 'git-format-patch mm-uu-type-alist))
    >> +        "^-- \\|^$"))

    Juri> Indeed, this is the right thing to do.  In the past
    Juri> few days I have seen more patches without attachments
    Juri> that makes hard to read them without fontification.
    Juri> So such change could help to greatly improve readability.
    Juri> However, often there is also text after the patch,
    Juri> so nil for 'end-point' doesn't look right.  So better
    Juri> to end the patch with an empty line, because properly
    Juri> formatted patches have no empty lines in them.

    Juri> diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
    Juri> index 3c7e3cbdf1a..26b2c03a3dc 100644
    Juri> --- a/lisp/gnus/mm-uu.el
    Juri> +++ b/lisp/gnus/mm-uu.el
    Juri> @@ -173,7 +173,7 @@ mm-uu-type-alist
    Juri>       ,#'mm-uu-diff-test)
    Juri>      (git-format-patch
    Juri>       "^diff --git "
    Juri> -     "^-- "
    Juri> +     "^$"
    Juri>       ,#'mm-uu-diff-extract
    Juri>       nil
    Juri>       ,#'mm-uu-diff-test)

    Juri> + PS: the patch above should end before this line.
    Juri> - I tested it on a few posts, and everything looks correct.

It works on your message, at least 😀

I think that would be a safe enough change.

Robert
--