From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#66450: 29.1; Debbugs/Gnus sometimes corrupt git formatted patches Date: Sat, 14 Oct 2023 09:43:46 -0700 Message-ID: <87sf6dcfy5.fsf@ericabrahamsen.net> References: <87y1gafi0n.fsf@gmail.com> <87a5sovqsn.fsf@ericabrahamsen.net> <87edhx44a6.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="36407"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66450@debbugs.gnu.org, Bruno Victal To: Maxim Cournoyer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 18:44:58 2023 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 1qrhl4-0009Ek-JS for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 18:44:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrhkn-0001Yb-A7; Sat, 14 Oct 2023 12:44:41 -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 1qrhkk-0001Y0-Vt for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 12:44:38 -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 1qrhkk-0008Ou-OH for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 12:44:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrhl8-0001o3-DY for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 12:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 16:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66450 X-GNU-PR-Package: emacs Original-Received: via spool by 66450-submit@debbugs.gnu.org id=B66450.16973018606880 (code B ref 66450); Sat, 14 Oct 2023 16:45:02 +0000 Original-Received: (at 66450) by debbugs.gnu.org; 14 Oct 2023 16:44:20 +0000 Original-Received: from localhost ([127.0.0.1]:50283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrhkR-0001mt-Mi for submit@debbugs.gnu.org; Sat, 14 Oct 2023 12:44:20 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:44582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrhkP-0001mh-LU for 66450@debbugs.gnu.org; Sat, 14 Oct 2023 12:44:18 -0400 Original-Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 37112FA151; Sat, 14 Oct 2023 16:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1697301828; bh=TPHyxq8IICwpldR2wPqLL94BrBslV1wYe505YzSXy70=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Db60NIazV6KlsSbZi/L8o+vGquUWOQUV5rAN7i2UQAyEem7ixlpprtM9H/v+W+I/r 5P9qqxglrT6mo6K7yv8hc/J+ch8h/COd1wJ/qOFlWopmeDkMSg0NjLcSQDfLa+ZbCr ZwWw4+ew0L5hqUSr1+lXbFN07EVQdklGSxP11t8Y= In-Reply-To: <87edhx44a6.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 14 Oct 2023 11:22:57 -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:272442 Archived-At: Maxim Cournoyer writes: > Hi Eric! > > Eric Abrahamsen writes: > >> Maxim Cournoyer writes: >> >>> Hello, >>> >>> While working via Emacs Debbugs, I noticed that applying a patch would >>> fail, and that this only occurred when fetching and saving the patch via >>> Debbugs/Gnus. Below is a reproducer: >>> >>> 1. mkdir -p src && cd src && git clone https://git.savannah.gnu.org/git= /guix.git >>> 2. cd guix && git checkout core-updates >>> 3. in emacs: M-x debbugs-gnu-bugs RET 65479 RET >>> 4. Navigate to the message with [PATCH core-updates v3 10/63] in its >>> subject >> >> This took way too long to figure out... >> >> TL;DR is: run "M-i r" before the "|" command. > > Oh, thank you, that works. > >> Gnus is treating the article with the `gnus-display-mime' treatment >> function, which ends up inserting newlines between detected MIME parts, >> in order to look "nice". It's not necessary to save the article to see >> this: the newlines are present if you just open Bruno's message and look >> at it. If you run `gnus-summary-show-raw-article', you'll see the >> original raw article with no newlines. >> >> The problem is that the Gnus summary "save-article" commands operate on >> the treated article, not the raw article. > > It'd be nice if that 'gnus-display-mime' procedure tried hard to *not* > break 'git format-patch' messages; perhaps it could use a simple > heuristic to do so. Out of the 63 patches in the series linked in the > reproducer steps, only patch 10/63 was corrupted by it, so it appears to > be a relatively rare occurrence. Is it possible that message in particular had multiple mime attachments, and the others didn't? I got the sense that the issue was with multiple attachments, or a message that isn't itself the attachment in question, but that contains attachments. Or something. >> BUT! Someone=E2=84=A2 anticipated that this would be an issue, and for >> `gnus-summary-pipe-output' in particular provided a "symbolic prefix" >> option for this command, a mechanism specific to Gnus that I'll wager >> very few are aware of. It lets you specify that the raw article should >> be piped instead of the treated article, by using "M-i" (to initiate the >> symbolic prefix), then "r" (the prefix itself). >> >> It's actually documented in the manual, though the fact that neither of >> us looked makes that feel a bit useless. It's also weird that only this >> pipe command has the option of operating on the raw article; you'd think >> that would be a useful option for the other article-saving commands, and >> you'd also think maybe this should be the default for the pipe command. > > I'd also opine that the pipe command should process the raw article by > default, but that's based on my sole experience with it, which nearly > always involve applying 'git format-patch' patches. By definition the pipe command will be sending the message to an exterior process, so you'd think you'd never want to run the treatment/washing commands, which have to do with user-facing article display. Gnus (and Emacs in general) is full of Chesterton's fences, though, and I would hesitate to go changing defaults like this.