From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Luis Henriques Newsgroups: gmane.emacs.bugs Subject: bug#72059: [PATCH] Ensure that git diffs without signature (--) are properly identified Date: Thu, 11 Jul 2024 16:01:35 +0100 Message-ID: <87cynkm0q8.fsf@orpheu.olymp> References: <87h6cwm86n.fsf@orpheu.olymp> <877cdshwyk.fsf@gmail.com> 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="12990"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72059@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 11 18:44:20 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 1sRwu3-00038M-GF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jul 2024 18:44:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRwto-0004iJ-Lc; Thu, 11 Jul 2024 12:44: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 1sRwtn-0004cl-3I for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 12:44: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 1sRwtm-0004fN-QQ for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 12:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRwtm-0002Dt-Gt for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 12:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Luis Henriques Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 16:44: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.17207161918476 (code B ref 72059); Thu, 11 Jul 2024 16:44:02 +0000 Original-Received: (at 72059) by debbugs.gnu.org; 11 Jul 2024 16:43:11 +0000 Original-Received: from localhost ([127.0.0.1]:52495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRwsw-0002Cd-Ay for submit@debbugs.gnu.org; Thu, 11 Jul 2024 12:43:11 -0400 Original-Received: from mout-p-102.mailbox.org ([80.241.56.152]:49400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRvIq-0004oz-Q5 for 72059@debbugs.gnu.org; Thu, 11 Jul 2024 11:01:51 -0400 Original-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== In-Reply-To: <877cdshwyk.fsf@gmail.com> (Robert Pluim's message of "Thu, 11 Jul 2024 15:36:35 +0200") X-Mailman-Approved-At: Thu, 11 Jul 2024 12:43:09 -0400 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:288743 Archived-At: 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 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@orpheu.olymp > > 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