GNU bug report logs - #72059
[PATCH] Ensure that git diffs without signature (--) are properly identified

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Luis Henriques <henrix@HIDDEN>; Keywords: patch; merged with #72058; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.0.50, send any further explanations to 72059 <at> debbugs.gnu.org and Luis Henriques <henrix@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 12 Jul 2024 17:57:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 13:57:29 2024
Received: from localhost ([127.0.0.1]:54759 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sSKWP-0008QY-N7
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 13:57:29 -0400
Received: from relay1-d.mail.gandi.net ([217.70.183.193]:51671)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>)
 id 1sSKWL-0008QD-EL; Fri, 12 Jul 2024 13:57:29 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 44904240002;
 Fri, 12 Jul 2024 17:57:16 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: =?iso-8859-1?Q?Lu=EDs?= Henriques <henrix@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <ZpDvEtibi8uJygs8@HIDDEN> (=?iso-8859-1?Q?=22Lu=EDs?=
 Henriques"'s message of "Fri, 12 Jul 2024 09:53:38 +0100")
Organization: LINKOV.NET
References: <87h6cwm86n.fsf@HIDDEN> <877cdshwyk.fsf@HIDDEN>
 <87cynkm0q8.fsf@HIDDEN> <87msmnnmoe.fsf@HIDDEN>
 <86ikxb3xy3.fsf@HIDDEN> <ZpDvEtibi8uJygs8@HIDDEN>
Date: Fri, 12 Jul 2024 20:55:31 +0300
Message-ID: <86cynilcks.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72059
Cc: 72059 <at> debbugs.gnu.org, Robert Pluim <rpluim@HIDDEN>,
 =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

close 72059 31.0.50
thanks

>> >   +(with-eval-after-load 'mm-uu
>> >   +  (setf (nth 1 (alist-get 'git-format-patch mm-uu-type-alist))
>> >   +        "^-- \\|^$"))
>> 
>> Indeed, this is the right thing to do.  In the past
>> few days I have seen more patches without attachments
>> that makes hard to read them without fontification.
>> So such change could help to greatly improve readability.
>> However, often there is also text after the patch,
>> so nil for 'end-point' doesn't look right.  So better
>> to end the patch with an empty line, because properly
>> formatted patches have no empty lines in them.
>> 
>> diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
>> index 3c7e3cbdf1a..26b2c03a3dc 100644
>> --- a/lisp/gnus/mm-uu.el
>> +++ b/lisp/gnus/mm-uu.el
>> @@ -173,7 +173,7 @@ mm-uu-type-alist
>>       ,#'mm-uu-diff-test)
>>      (git-format-patch
>>       "^diff --git "
>> -     "^-- "
>> +     "^$"
>>       ,#'mm-uu-diff-extract
>>       nil
>>       ,#'mm-uu-diff-test)
>> 
>> + PS: the patch above should end before this line.
>> - I tested it on a few posts, and everything looks correct.
>
> Ah! Nice, this indeed looks better than my proposal.  Thanks!  Hopefully
> this will be acceptable for merging.

Thanks for the request!  So now this is pushed to master.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 12 Jul 2024 08:29:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 04:29:53 2024
Received: from localhost ([127.0.0.1]:53149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sSBf6-0004P1-Qt
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 04:29:53 -0400
Received: from mail-wm1-f53.google.com ([209.85.128.53]:59881)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1sSBf3-0004Oi-BJ
 for 72059 <at> debbugs.gnu.org; Fri, 12 Jul 2024 04:29:51 -0400
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-42660b8dd27so11295575e9.3
 for <72059 <at> debbugs.gnu.org>; Fri, 12 Jul 2024 01:29:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1720772923; x=1721377723; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=1CI70XSgfZwlwtp2abH8P8xKdiVkEQtspDK3B4vrkgM=;
 b=TGIg9Fiz1NCQI3j4EBkfShZujRbs8rRN3YzBjOCG1M9I5XB5qAs/emNK1ng3nWqtyW
 4nYCBv+x2VHj65JyiP/ROwxnUe5zgvfstp7hqtWRJE/DO5XCglGaGcuhavxP3Konn4uA
 FZWQUenDJbAlneB4Yin/SsiO1HlC6JNuOzZxMmGhxWJa0eIVqpfTrLkN3QoRPjt/UtvB
 hCB2szGH9ycq2WbUmxvHmls0yikJrrM1wnDtsAi2f5dfLPuJVMwad2OtK3FsBQztpI58
 UwK4k+Mqyzhoc+XVCEMegL0Hu3X0Qxyj6uGiKW46NZ1kRSVz0Hr+3s7lB/F93CEvY5Lg
 es1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1720772923; x=1721377723;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=1CI70XSgfZwlwtp2abH8P8xKdiVkEQtspDK3B4vrkgM=;
 b=a8pflV/zZ/QMSu8B2Nl3sst1Pnh7CW/cMkKZdNyHCZ3TcROxJws29s5On81Wd4SjQh
 gzlGc9GdyRqObGVTAvCjGzKXvZlwOb6ilqXujrHNbx77l8Ir04Nh0NEJ1xsv+38/55SN
 on8VJbg0Noag750kKxsIYWw+31tEsMURvMG4HlSeQ8/ykre+twWlAoyYKP5uhvBQRioY
 9VxiTpLXpKKGotLruHhn1+ee+lvQYtvEtXg+YsO/wZjawoGi1Dlzy+g/doEBQWfbJlHx
 zOwfF8rQdu7DR2ceZD1xn/tAoVp4PSkVQZ2HLMpz2fOOMYE2xvB0JjY9FYJbHon/VeSJ
 /xcQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCWxRx5LeHfuGIwrKiL/1PliHATL55z4KYsw3FkFIXHG0p+n+Byv8peNjTMFQQ8ANAthqVgHqljJZPMwmNymiLmPcysRLAc=
X-Gm-Message-State: AOJu0Ywi+2Xh2Ci4FLY/auJ790Uetj+rLPLe3b6r5cRvE8O6AvNv0Bhb
 PA4Df04QufzfMo9lYVn9zU0Nza1jFbpwejxIGj81g/dQaUXPAJMfqQ7rTw==
X-Google-Smtp-Source: AGHT+IGTfTf/M/fJtjkfv58YR1aEtE+B2h8Swhbtq8uMYpYS7xZrr3PlPhNwba0WIOJ53cRi6dFNgg==
X-Received: by 2002:a05:600c:4988:b0:426:66e9:b844 with SMTP id
 5b1f17b1804b1-426707ce98fmr91821945e9.8.1720772922933; 
 Fri, 12 Jul 2024 01:28:42 -0700 (PDT)
Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4279f276b14sm14797665e9.23.2024.07.12.01.28.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 12 Jul 2024 01:28:42 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <86ikxb3xy3.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 12 Jul 2024 09:51:16 +0300")
References: <87h6cwm86n.fsf@HIDDEN> <877cdshwyk.fsf@HIDDEN>
 <87cynkm0q8.fsf@HIDDEN> <87msmnnmoe.fsf@HIDDEN>
 <86ikxb3xy3.fsf@HIDDEN>
Date: Fri, 12 Jul 2024 10:28:41 +0200
Message-ID: <87h6cvf1za.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72059
Cc: Luis Henriques <henrix@HIDDEN>, 72059 <at> debbugs.gnu.org,
 =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Fri, 12 Jul 2024 09:51:16 +0300, Juri Linkov <juri@HIDDEN> sai=
d:

    >> +(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 =F0=9F=98=80

I think that would be a safe enough change.


Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 12 Jul 2024 06:53:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 02:53:05 2024
Received: from localhost ([127.0.0.1]:53045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sSA9Q-0001wd-TN
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:53:05 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:38931)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1sSA9M-0001w5-RP
 for 72059 <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:53:03 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 2558D40002;
 Fri, 12 Jul 2024 06:52:31 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: =?iso-8859-1?Q?K=E9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <87msmnnmoe.fsf@HIDDEN> (=?iso-8859-1?Q?=22K=E9vin?= Le
 Gouguec"'s message of "Fri, 12 Jul 2024 08:34:25 +0200")
Organization: LINKOV.NET
References: <87h6cwm86n.fsf@HIDDEN> <877cdshwyk.fsf@HIDDEN>
 <87cynkm0q8.fsf@HIDDEN> <87msmnnmoe.fsf@HIDDEN>
Date: Fri, 12 Jul 2024 09:51:16 +0300
Message-ID: <86ikxb3xy3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72059
Cc: Luis Henriques <henrix@HIDDEN>, 72059 <at> debbugs.gnu.org,
 Robert Pluim <rpluim@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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

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

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

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 12 Jul 2024 06:35:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 12 02:35:37 2024
Received: from localhost ([127.0.0.1]:53036 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sS9sW-0001We-NA
	for submit <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:35:37 -0400
Received: from mail-lf1-f49.google.com ([209.85.167.49]:57647)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1sS9sT-0001WO-TM
 for 72059 <at> debbugs.gnu.org; Fri, 12 Jul 2024 02:35:35 -0400
Received: by mail-lf1-f49.google.com with SMTP id
 2adb3069b0e04-52ea0f18500so1719436e87.3
 for <72059 <at> debbugs.gnu.org>; Thu, 11 Jul 2024 23:35:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1720766067; x=1721370867; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=7hY7wbBo2BomDdiSRw3eW+Mr/o2lraEU3XiAaLRG5Ag=;
 b=X37INV/1bV4cAyu3VfB0SE2BTU2CF3KuWHkGXEh7ynlPvQX2VUcHslAybu3MKch3Fp
 w6JbbdSCMYo1DLW1NYWLl+37GP5oSvr8rjMjPS0F6VnY9+VZJxx8Gf/xCLO8vfeOuADS
 skTYBTZPfPSRvdkZtqq1eu7tqaFGjP1F6y1909IXpgFvjpgCGUaw7gCS68iERSeu6MIx
 8CbpM1LM9VBJxo4NgXQWu0ih//FdKY7MPfGGr8O3M6qJIzQZ9luQHtLH2QSlIMax1fFJ
 n/G+U93EsEOL55iRv8EA1R6nnHX3MI5qaVdn6rEY5tWUqnTRhRwNyqW5YI57iL5e5DmN
 lQiA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1720766067; x=1721370867;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date:message-id:reply-to;
 bh=7hY7wbBo2BomDdiSRw3eW+Mr/o2lraEU3XiAaLRG5Ag=;
 b=OO9jXD4BzfcC2HRwVBGlKI2+1d+ZjrDQ+DsRKp8Pwf7sloi4BeFW66xK46bamg69Qu
 sISkAvcGbmCGD3eGdORQh4JrrmsI9Q/dYbY046Zc92QQfUcQov2YR7Tss/8NtXsOJPw4
 HhNDav+ZuVTg74pkGdCF+eNa5XJhuruVFODVLEI4n8skRwo/lb9260qwW7SEH+JGMGWM
 dDRh7y3eVQ4+SsIyIHMyit18UEON2cQhLRWvYFc4IkixWQD5ih9kIGTRp/G14UEuPyFr
 EjfSJJPDlXToSsVVI56vJ9tb0nGRUmpkOSFzZnBPC5/HpSPT5hPoImkLHtorySVopEHt
 Vfzg==
X-Forwarded-Encrypted: i=1;
 AJvYcCWEMskQFeeCelqwEWA2tXl8jub4Dzg/pGGJp3mwjXSxD4P0MlBdYfeBik8FDriTz9Ip24FV3i2f6a4ap0hp4oy1pEWXyCE=
X-Gm-Message-State: AOJu0YxcMU7ZzeLsBtprnkVKPKYwEU0Z/QbMWIquk7CRXtPOsc4Vrom5
 vCtcqxrqWflBuee/rUUNMGFN4oqJjzZDhoWBUnvGxO+oN5LJHg0JbPzlVw==
X-Google-Smtp-Source: AGHT+IEmshktbf92xBkiZUgs9BX/V+6RDNnevekyeXJESPXfb6GKTi/VenNlwNcWeNT3Im7MdEqJxg==
X-Received: by 2002:a05:6512:3d02:b0:52c:dbc2:ea1 with SMTP id
 2adb3069b0e04-52eb998fc1cmr7238472e87.6.1720766067065; 
 Thu, 11 Jul 2024 23:34:27 -0700 (PDT)
Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4279f244950sm11462345e9.7.2024.07.11.23.34.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 11 Jul 2024 23:34:26 -0700 (PDT)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: Luis Henriques <henrix@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <87cynkm0q8.fsf@HIDDEN> (Luis Henriques's message of "Thu, 
 11 Jul 2024 16:01:35 +0100")
References: <87h6cwm86n.fsf@HIDDEN> <877cdshwyk.fsf@HIDDEN>
 <87cynkm0q8.fsf@HIDDEN>
Date: Fri, 12 Jul 2024 08:34:25 +0200
Message-ID: <87msmnnmoe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72059
Cc: 72059 <at> debbugs.gnu.org, Robert Pluim <rpluim@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Luis Henriques <henrix@HIDDEN> writes:

>> Also, how does this work for messages containing multiple patches? Is
>> detection of just the start of each patch enough?
>
> Do you have an example where this happens?  I don't think I ever saw an
> email with two inlined patches.  But obviously, with this patch applied,
> everything from the "^diff --git " up to the end of the email will be a
> diff.  Just like everything after "^=3D=3D=3D modified file " or "^Index:=
 " will
> be a diff.

FWIW, I've had this uncommitted kludge in my config for some time now:

  @@ -403,6 +431,9 @@

   ;; TODO: handle inline diffs in Gnus articles; maybe tweaking
   ;; mm-uu-type-alist?
  +(with-eval-after-load 'mm-uu
  +  (setf (nth 1 (alist-get 'git-format-patch mm-uu-type-alist))
  +        "^-- \\|^$"))

Past Me wasn't considerate enough to add a Message-ID demonstrating
where this fixes problems.  An earlier version of that config featured:

  ;; Gerrit does not include trailing "-- ".
  (with-eval-after-load 'mm-uu
    (setf (nth 1 (alist-get 'git-format-patch mm-uu-type-alist))
          "^-- \\|\\'"))

Past Me eventually ditched this for being, citing the commit message,
"too flaky".  Again, did not bother to add a reference to a problematic
sample =F0=9F=99=84

I think the logic behind "^-- \\|^$" is that ^$ ought to find the end of
a "very-inlined patch" (i.e. not "attached", not even as an inlined
part; think 'C-x v d', 'C-x h' 'M-w', 'C-x o', 'C-y') because even empty
context lines have a leading space=E2=80=A6

=E2=80=A6 but that's just guesswork.  Thought it'd be worth mentioning, but=
 feel
free to ignore the noise if not helpful.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 11 Jul 2024 16:43:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 12:43:11 2024
Received: from localhost ([127.0.0.1]:52495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRwsw-0002Cd-Ay
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 12:43:11 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152]:49400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <henrix@HIDDEN>) id 1sRvIq-0004oz-Q5
 for 72059 <at> debbugs.gnu.org; Thu, 11 Jul 2024 11:01:51 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4WKdGq3bl8z9sV3;
 Thu, 11 Jul 2024 17:01:39 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=camandro.org;
 s=MBO0001; t=1720710099;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=1x2C4cwhr3X89nOkx13zgwNr6XnL5Ja8VRrfV1VcNI4=;
 b=XUZoGhwul5PpACH3BJwGggbvraXOJXzr/UjdIcvEc8bTgOSvKE3wrdwrnwjUSwlZNHSuXf
 eTfT+VanK6uk98iKRn6vyInLbR8kcSXakgkK2/lU9wcRCAB2yjNEQR97dvbDgJL86nb+ck
 DaEmK10pShQ6fNKp9OXl3MrgONq9c46E5hXev9RLpNX8mWPmd/rC4tNBV7mMfEHFRhYLpj
 Z0N0sLtvQlo2eAGBBenHRXPTQXZDwm6HR8gqk6kdue1dQ6GLU6N2E69i0VL2fi7ruD9RXM
 t2My7z6DgNwE65V4cn6vsV4VwjguaaZF1VX0U/tWczv61yEmE839i02F0N3tTg==
From: Luis Henriques <henrix@HIDDEN>
To: Robert Pluim <rpluim@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <877cdshwyk.fsf@HIDDEN> (Robert Pluim's message of "Thu, 11
 Jul 2024 15:36:35 +0200")
References: <87h6cwm86n.fsf@HIDDEN> <877cdshwyk.fsf@HIDDEN>
Date: Thu, 11 Jul 2024 16:01:35 +0100
Message-ID: <87cynkm0q8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 72059
X-Mailman-Approved-At: Thu, 11 Jul 2024 12:43:09 -0400
Cc: 72059 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Robert!

(First of all, thank you for your review!)

On Thu, Jul 11 2024, Robert Pluim wrote:

>>>>>> On Thu, 11 Jul 2024 13:20:32 +0100, Luis Henriques <henrix@camandro.=
org> said:
>
>     Luis> Hi!
>     Luis> [Resending as I don't see message in the list after a few hours=
.]
>
> I see both those messages. There is moderation for unsubscribed users,
> so sometimes there is lag.

Yeah, sorry.  I saw both hitting the list pretty much at the same time.  I
guess I was just too eager on getting it there.

>
>     Luis> I'd like to have git-format-patch diffs to be properly identifi=
ed when I'm
>     Luis> using Gnus to read mailing-lists.  It mostly works fine, *if* t=
he
>     Luis> (inlined) patches include a signature at the end ('--').  If th=
e signature
>     Luis> is missing then the patch isn't identified as such.
>
>     Luis> Since all the other diff formats in mm-uu-type-alist don't have=
 the
>     Luis> 'end-point' I thought it would be fine to also remove it from t=
he
>     Luis> 'git-format-patch'.
>
> git-format-patch only produces patches like that if you pass it
> '--no-signature', I think.

Or you may just set 'format.signature' to an empty string in your config,
which is what I have been using almost since day one.  This will prevent
git from leaking it's version.

>     Luis> The issue I'm trying to fix can be easily seen in Gnus by compa=
ring two
>     Luis> emails with the following message-ids from the emacs-devel@gnu.=
org
>     Luis> mailing-list:
>
>     Luis>   87v81dmhxi.fsf@HIDDEN
>
> That one actually looks like just 'git diff' rather than 'git format-patc=
h'

I didn't go check, but if I had to guess, 'git format-patch' actually uses
'git diff' for generating the diff (with stats) and adds a signature at
the end (if configured to do so).

Anyway, I always send patches without git signature, generated with 'git
format-patch' and (most of the time) sent with 'git send-email'.  And
those are never identified as patches.

> I=CA=BCm trying to work out the benefit here compared to the status quo vs
> the risk of breaking something. If Gnus doesn=CA=BCt identify such messag=
es
> as containing patches, you don=CA=BCt get the in-article buttons, but you
> can still pipe the message to 'git apply'.

Right, the only benefit is just the extra eye-candy stuff.

> Also, how does this work for messages containing multiple patches? Is
> detection of just the start of each patch enough?

Do you have an example where this happens?  I don't think I ever saw an
email with two inlined patches.  But obviously, with this patch applied,
everything from the "^diff --git " up to the end of the email will be a
diff.  Just like everything after "^=3D=3D=3D modified file " or "^Index: "=
 will
be a diff.

> Maybe adding a new detection method would be better?

The problem I see with that is that this new detection method will
necessarily overlap with the 'git-format-patch' in mm-uu-type-alist.
Won't it simply shadow it, and will always be used?

Cheers,
--=20
Lu=C3=ADs




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.
Merged 72058 72059. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 11 Jul 2024 13:57:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 09:57:30 2024
Received: from localhost ([127.0.0.1]:52289 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRuIb-0005Re-PL
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 09:57:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1sRuIW-0005RI-AT; Thu, 11 Jul 2024 09:57:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1sRuIQ-0004C5-W9; Thu, 11 Jul 2024 09:57:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=39x/eYJP3t14b+jF2XIFrUwfjpp9I2kM9hsvadUAGF4=; b=U51SXUqOAPCs
 J/pndxDcB7++hmv5B3LtOzUlhRNeYaBJ5xT/249/wTu2LI0lUM9w/K7HOv/pcf0lfok2hoBi/uZSM
 g9O+0I7EJJDNxmSMee3rFVAQ/fQItsE2NVEjXypTOxPJoG9Gv82dNsz4hEWv/Jtvja/zigMyIz3rJ
 /eqRFh/cWqIPjXJGzm215YYdLVjh7TWH97MqfJOridZC3mb9O7gVOq4OEbAWyXYjtDLloJtvEiC/E
 1tAkjZPNKIZOIHB556IgG1O5EpC70cwFMHe+LgSO5TpqhGpngRC9Q+3XE9DL9A8hbY/rcmRfojmiP
 0YKVnxdnmjPvpfk74SJDPA==;
Date: Thu, 11 Jul 2024 16:57:13 +0300
Message-Id: <86a5iom3pi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Luis Henriques <henrix@HIDDEN>
In-Reply-To: <87h6cwm86n.fsf@HIDDEN> (message from Luis Henriques on
 Thu, 11 Jul 2024 13:20:32 +0100)
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
References: <87h6cwm86n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 72059
Cc: 72059 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

merge 72059 72058
thanks

> From: Luis Henriques <henrix@HIDDEN>
> Date: Thu, 11 Jul 2024 13:20:32 +0100
> 
> [Resending as I don't see message in the list after a few hours.]

Merging the two identical bug reports.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at 72059 <at> debbugs.gnu.org:


Received: (at 72059) by debbugs.gnu.org; 11 Jul 2024 13:37:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 09:37:48 2024
Received: from localhost ([127.0.0.1]:51294 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRtzX-0004dt-MJ
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 09:37:48 -0400
Received: from mail-lf1-f50.google.com ([209.85.167.50]:50390)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1sRtzT-0004df-Td
 for 72059 <at> debbugs.gnu.org; Thu, 11 Jul 2024 09:37:46 -0400
Received: by mail-lf1-f50.google.com with SMTP id
 2adb3069b0e04-52e9c6b5a62so965214e87.0
 for <72059 <at> debbugs.gnu.org>; Thu, 11 Jul 2024 06:37:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1720704998; x=1721309798; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=yCCIw/dDwlkY4TsYyKc7brdDZvLr2Xfc/SR8es4QlHI=;
 b=ToPM9dLSjvc1r39TMPBDDaoidV4gwT0KVZH2E1wKN+sG2a1DPLkTbExWTzlZSkOJQf
 8ltNW+ITPVDaQRsxgxc1tLjRN4KzcheBL9zVMWMruzAN5CVa8kBBHz+3INuXmUvjTWE1
 7d4NwQousIxVSEpM5wi0DWRQxE16MgHD94+9S2c4bqnCz5p44uVOxAGVFfTu5o8P8zBF
 lhtasiZSmxY+2UUySHxh0Smdzehjg8skhcTFatoT1iqEttDkn2Y0ejx0RkfCPp3Dx8AZ
 6el487KzUIUza9l1q8obtltnRBfhvK4mrQ1XpcFvUn2zKCcTZ9Fd8hFxxKFWNCPxeHbP
 V7lg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1720704998; x=1721309798;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=yCCIw/dDwlkY4TsYyKc7brdDZvLr2Xfc/SR8es4QlHI=;
 b=qBAhvXNvwfCSYqFj7YLRX1iGipVQnK95GOtCYOYlxBwM6a8WmZMsXbxbgAaciephC8
 XxKkqz8eRX18R/I24UrRTX4nkDEsxXGJ1gI9Vu3NuzShuVz5S4OIJXFHjIHHgSyv4/sN
 tHFKkH5QEg/R70CTGjgtpcv4xqRRFbhQunxxB7pSzTpjHMPbmooGUyIrhpON5lQIDt0J
 0Zf8BNtx84R9iezoi+5kF2PseX00N7ylKsiagCa7N4v5zHHfnfHGs4w+niFyVspEn39e
 hsLKRhT+/UoWC9LLMccnOnM2l9hrszsWptILmcPCA+hPDrQ/zzLMwpqAfsbrTWfo9Dkt
 tuXQ==
X-Gm-Message-State: AOJu0YyeThRsScwXkb/00vIQEcDuqPVIfy65NnjXHvI5gtD6XawftJ3W
 +9MLISpjpxmbxxPNnUypDo4hUWX70njwduskiRcu+YzJD4RjV70GalDkKA==
X-Google-Smtp-Source: AGHT+IEajg/GiU1czbgDi5NrMNZ87F029Px9u2Tr2sBvQmuxyt1Smk1OMsqF/xN3L+KTnHiDocao0w==
X-Received: by 2002:a05:6512:114c:b0:52c:e0bc:ca3a with SMTP id
 2adb3069b0e04-52eb99d76a5mr5521337e87.64.1720704997256; 
 Thu, 11 Jul 2024 06:36:37 -0700 (PDT)
Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4264a1f22acsm288128075e9.24.2024.07.11.06.36.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 11 Jul 2024 06:36:36 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Luis Henriques <henrix@HIDDEN>
Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--)
 are properly identified
In-Reply-To: <87h6cwm86n.fsf@HIDDEN> (Luis Henriques's message of "Thu, 
 11 Jul 2024 13:20:32 +0100")
References: <87h6cwm86n.fsf@HIDDEN>
Date: Thu, 11 Jul 2024 15:36:35 +0200
Message-ID: <877cdshwyk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 72059
Cc: 72059 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Thu, 11 Jul 2024 13:20:32 +0100, Luis Henriques <henrix@HIDDEN=
rg> said:

    Luis> Hi!
    Luis> [Resending as I don't see message in the list after a few hours.]

I see both those messages. There is moderation for unsubscribed users,
so sometimes there is lag.

    Luis> I'd like to have git-format-patch diffs to be properly identified=
 when I'm
    Luis> using Gnus to read mailing-lists.  It mostly works fine, *if* the
    Luis> (inlined) patches include a signature at the end ('--').  If the =
signature
    Luis> is missing then the patch isn't identified as such.

    Luis> Since all the other diff formats in mm-uu-type-alist don't have t=
he
    Luis> 'end-point' I thought it would be fine to also remove it from the
    Luis> 'git-format-patch'.

git-format-patch only produces patches like that if you pass it
'--no-signature', I think.

    Luis> The issue I'm trying to fix can be easily seen in Gnus by compari=
ng two
    Luis> emails with the following message-ids from the emacs-devel@HIDDEN
    Luis> mailing-list:

    Luis>   87v81dmhxi.fsf@HIDDEN

That one actually looks like just 'git diff' rather than 'git format-patch'

I=CA=BCm trying to work out the benefit here compared to the status quo vs
the risk of breaking something. If Gnus doesn=CA=BCt identify such messages
as containing patches, you don=CA=BCt get the in-article buttons, but you
can still pipe the message to 'git apply'.

Also, how does this work for messages containing multiple patches? Is
detection of just the start of each patch enough?

Maybe adding a new detection method would be better?

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Jul 2024 13:09:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 11 09:09:26 2024
Received: from localhost ([127.0.0.1]:51252 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sRtY5-0003ex-MD
	for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 09:09:26 -0400
Received: from lists.gnu.org ([209.51.188.17]:54026)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <henrix@HIDDEN>) id 1sRsn1-0002M9-O7
 for submit <at> debbugs.gnu.org; Thu, 11 Jul 2024 08:20:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <henrix@HIDDEN>)
 id 1sRsmy-0001x3-CM
 for bug-gnu-emacs@HIDDEN; Thu, 11 Jul 2024 08:20:46 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <henrix@HIDDEN>)
 id 1sRsmw-0007wg-AA
 for bug-gnu-emacs@HIDDEN; Thu, 11 Jul 2024 08:20:44 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org
 [IPv6:2001:67c:2050:b231:465::1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4WKYj01XQKz9svH
 for <bug-gnu-emacs@HIDDEN>; Thu, 11 Jul 2024 14:20:36 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=camandro.org;
 s=MBO0001; t=1720700436;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type;
 bh=BzuDbQOz48bc0zETWs9df8COemfxwQJlYZ80mk9GwxI=;
 b=qMufHaokCQTi6JCsBxUNk8Gv+iHr82tqA/ZdNDoj6L3AVLGShNWvpPCTkIrqC9ntNXx2RU
 YAobJSn5GrQDxWABciHkb3D/kVJ/QGh9v7HsT/p9ppGSuBP+Y2mKN+E+WHaNTCj7QACI3c
 BVJqB34quKEjhg++zzn3kqrQX8QdA4usQN7vRfXdx7mseuGnTk4/ONLolA85/Pgk5GYsPm
 eGgcDxc4g4ekWDtNgPBBpP+gVcATpDCEbg4HDXo0zdxixEyYLnjBCGDrpKeitDZzfR6Xed
 7n+e9XlK2VUTgdX195sW3gInb/0aasuy2BWX9GeCs89qjNcL7oetoi5QRHuk/g==
From: Luis Henriques <henrix@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Ensure that git diffs without signature (--) are properly
 identified
Date: Thu, 11 Jul 2024 13:20:32 +0100
Message-ID: <87h6cwm86n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Rspamd-Queue-Id: 4WKYj01XQKz9svH
Received-SPF: pass client-ip=80.241.56.171; envelope-from=henrix@HIDDEN;
 helo=mout-p-201.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 11 Jul 2024 09:09:18 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi!

[Resending as I don't see message in the list after a few hours.]

I'd like to have git-format-patch diffs to be properly identified when I'm
using Gnus to read mailing-lists.  It mostly works fine, *if* the
(inlined) patches include a signature at the end ('--').  If the signature
is missing then the patch isn't identified as such.

Since all the other diff formats in mm-uu-type-alist don't have the
'end-point' I thought it would be fine to also remove it from the
'git-format-patch'.

The issue I'm trying to fix can be easily seen in Gnus by comparing two
emails with the following message-ids from the emacs-devel@HIDDEN
mailing-list:

  87v81dmhxi.fsf@HIDDEN
  20240702155100.2150717-1-brennan@HIDDEN

(These emails can be accessed by entering the Gnus group, hitting 'j'
(gnus-summary-goto-article) and yanking the above message-ids.)

Cheers,
--=20
Lu=C3=ADs


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Ensure-that-git-diffs-without-signature-are-properly.patch

From fb9a1413655837607b2ed91d11d5cb2e3ba99415 Mon Sep 17 00:00:00 2001
From: Luis Henriques <henrix@HIDDEN>
Date: Thu, 11 Jul 2024 10:02:04 +0100
Subject: [PATCH] Ensure that git diffs without signature (--) are properly
 identified

* lisp/gnus/mm-uu.el (mm-uu-type-alist): Remove 'end-point' from
git-format-patch diffs so that diffs without signature can be identified.
---
 lisp/gnus/mm-uu.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

--=-=-=--




Acknowledgement sent to Luis Henriques <henrix@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#72059; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 12 Jul 2024 18:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.