From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#72059: [PATCH] Ensure that git diffs without signature (--) are properly identified Date: Fri, 12 Jul 2024 10:28:41 +0200 Message-ID: <87h6cvf1za.fsf@gmail.com> References: <87h6cwm86n.fsf@orpheu.olymp> <877cdshwyk.fsf@gmail.com> <87cynkm0q8.fsf@orpheu.olymp> <87msmnnmoe.fsf@gmail.com> <86ikxb3xy3.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2248"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Luis Henriques , 72059@debbugs.gnu.org, =?UTF-8?Q?K=C3=A9vin?= Le Gouguec To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 12 10:31:01 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sSBgC-0000KJ-UH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Jul 2024 10:31:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSBfI-0006L0-KU; Fri, 12 Jul 2024 04:30:04 -0400 Original-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 1sSBfH-0006Hg-4I for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 04:30:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSBfG-0006Hw-N7 for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 04:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSBfG-0004Pm-Gn for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 04:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2024 08:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72059 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72059-submit@debbugs.gnu.org id=B72059.172077299316931 (code B ref 72059); Fri, 12 Jul 2024 08:30:02 +0000 Original-Received: (at 72059) by debbugs.gnu.org; 12 Jul 2024 08:29:53 +0000 Original-Received: from localhost ([127.0.0.1]:53149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSBf6-0004P1-Qt for submit@debbugs.gnu.org; Fri, 12 Jul 2024 04:29:53 -0400 Original-Received: from mail-wm1-f53.google.com ([209.85.128.53]:59881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSBf3-0004Oi-BJ for 72059@debbugs.gnu.org; Fri, 12 Jul 2024 04:29:51 -0400 Original-Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-42660b8dd27so11295575e9.3 for <72059@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) Original-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) In-Reply-To: <86ikxb3xy3.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 12 Jul 2024 09:51:16 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288768 Archived-At: >>>>> On Fri, 12 Jul 2024 09:51:16 +0300, Juri Linkov 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