From unknown Sun Jul 27 09:34:24 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72058: [PATCH] Ensure that git diffs without signature (--) are properly identified Resent-From: Luis Henriques Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 13:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72058 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 72058@debbugs.gnu.org Cc: Luis Henriques X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172070336514074 (code B ref -1); Thu, 11 Jul 2024 13:10:03 +0000 Received: (at submit) by debbugs.gnu.org; 11 Jul 2024 13:09:25 +0000 Received: from localhost ([127.0.0.1]:51250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRtY3-0003eo-MU for submit@debbugs.gnu.org; Thu, 11 Jul 2024 09:09:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:42432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRq1z-0006Bk-7T for submit@debbugs.gnu.org; Thu, 11 Jul 2024 05:24:04 -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 ) id 1sRq1z-0005GU-AJ for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 05:24:03 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1sRq1v-0002Gm-RJ for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 05:24:03 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.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-102.mailbox.org (Postfix) with ESMTPS id 4WKTn70yZdz9sc0; Thu, 11 Jul 2024 11:23:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=camandro.org; s=MBO0001; t=1720689835; 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; bh=bb0bCSjZ1I8xdGnn6yWljv4OS7d31w6jKHnaZ14LtFU=; b=ExKFMnoNx757vgZsPpPIN9VbIOsv8RYJF+Tdef9EPLFSrem8OjJ8EP2vqKweUiDC7QCrHC NRiJcqHYjL2p2TLlXT84c5GFzgsi4LLuk1ddbKQ2rVmyAqelP6VfbXzkPmebH4lIyUXg4X hFUmE2di7u4GKqzBSbm2qM9cSGevbM/SB8GQoFKi//LTl526csa07HMDvx9XFA370rBdUf lqanADZHqYQqUmZ6cRDpndSBh8pjAlLRM2B1LYxjSxW+mRxq6j30lKgheh2jyTmxbcKVdq YJ285TmOUA5OGiUehEtPXTDqk3Zok2nR1Ar4kkFfehe/PxuI2dOchsDThmpGWA== From: Luis Henriques Date: Thu, 11 Jul 2024 10:23:51 +0100 Message-ID: <87msmomgd4.fsf@orpheu.olymp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=80.241.56.152; envelope-from=henrix@camandro.org; helo=mout-p-102.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-Mailman-Approved-At: Thu, 11 Jul 2024 09:09:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch Hi! 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@gnu.org mailing-list: 87v81dmhxi.fsf@orpheu.olymp 20240702155100.2150717-1-brennan@umanwizard.com (These emails can be accessed by entering the Gnus group, hitting 'j' (gnus-summary-goto-article) and yanking the above message-ids.) --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Ensure-that-git-diffs-without-signature-are-properly.patch >From fb9a1413655837607b2ed91d11d5cb2e3ba99415 Mon Sep 17 00:00:00 2001 From: Luis Henriques 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) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 11 09:57:30 2024 Received: (at control) by debbugs.gnu.org; 11 Jul 2024 13:57:30 +0000 Received: from localhost ([127.0.0.1]:52291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRuIc-0005Rg-2M for submit@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 ) 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 ) 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@gnu.org> From: Eli Zaretskii To: Luis Henriques In-Reply-To: <87h6cwm86n.fsf@orpheu.olymp> (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@orpheu.olymp> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: 72059@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 72059 72058 thanks > From: Luis Henriques > 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 13:57:30 2024 Received: (at control) by debbugs.gnu.org; 12 Jul 2024 17:57:30 +0000 Received: from localhost ([127.0.0.1]:54761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSKWQ-0008Qf-0e for submit@debbugs.gnu.org; Fri, 12 Jul 2024 13:57:30 -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 ) 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 To: =?iso-8859-1?Q?Lu=EDs?= Henriques Subject: Re: bug#72059: [PATCH] Ensure that git diffs without signature (--) are properly identified In-Reply-To: (=?iso-8859-1?Q?=22Lu=EDs?= Henriques"'s message of "Fri, 12 Jul 2024 09:53:38 +0100") Organization: LINKOV.NET References: <87h6cwm86n.fsf@orpheu.olymp> <877cdshwyk.fsf@gmail.com> <87cynkm0q8.fsf@orpheu.olymp> <87msmnnmoe.fsf@gmail.com> <86ikxb3xy3.fsf@mail.linkov.net> Date: Fri, 12 Jul 2024 20:55:31 +0300 Message-ID: <86cynilcks.fsf@mail.linkov.net> 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@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control Cc: 72059@debbugs.gnu.org, Robert Pluim , =?iso-8859-1?Q?K=E9vin?= Le Gouguec X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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.