From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#43297: 27.1; corrupts patch when diff-update-on-the-fly is set to nil Date: Fri, 16 Oct 2020 16:47:49 +0200 Message-ID: <87r1py448a.fsf@gnus.org> References: <87r1rag254.fsf@netris.org> <87y2k6oebn.fsf@gnus.org> <87sgaeodr1.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29179"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Mark H Weaver , 43297@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 16 16:52:04 2020 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 1kTR5P-0007Q2-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 16:52:03 +0200 Original-Received: from localhost ([::1]:45482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTR5O-0006oi-Ny for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 10:52:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTR2V-0004VS-Tn for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 10:49:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTR2T-0002ul-VC for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 10:49:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTR2T-0005j9-Tz for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 10:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Oct 2020 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43297 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 43297-submit@debbugs.gnu.org id=B43297.160285968121923 (code B ref 43297); Fri, 16 Oct 2020 14:49:01 +0000 Original-Received: (at 43297) by debbugs.gnu.org; 16 Oct 2020 14:48:01 +0000 Original-Received: from localhost ([127.0.0.1]:60459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTR1V-0005hN-J1 for submit@debbugs.gnu.org; Fri, 16 Oct 2020 10:48:01 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:57070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTR1T-0005gl-V4 for 43297@debbugs.gnu.org; Fri, 16 Oct 2020 10:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WjnqRVSzYEoUjxekegwFY2JyC1TuK5U0AuFLrKn2jWo=; b=tNENUvjsLfRGPU2NHh/mSPyd33 I0aZyOygBGwi8ItiMDDgfOkrgHxTqsTdnQnJvCo0V0P7dkaOdFFLMSGb1vYNfnzI8/ysSkwGjR7Nb MeSkEbNGx394ewGLZrsTyahymywdci85crgIeJIRmPQKU5t4pBWrYnL3+zHdczan2ZRw=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTR1K-0004O8-KN; Fri, 16 Oct 2020 16:47:53 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAMFBMVEX+/v7s6ejj393R zMtnXVuyrKssIB9EOTeDeHYzJyUkGRgaEBDGvbhQPzuelZL///8RPH+VAAAAAWJLR0QPGLoA2QAA AAd0SU1FB+QKEA4lDl59bOAAAACTSURBVDjLY2AYBUMLMCoIMxhgk2B2CDMoYW7ClGB1iFRcwrLZ 5AAWCaUtLLmZjpgSYUpLni+bYYBFh3Lmqi2Y9vNceGW3O30qFlcVvKrebpqHRWKO99odfOswJZhm 7n66hRWLDtZdt4238JRgSrzeah2UwnwF04oplzQfTmeIwwxDAyUmARcBXCHMMAoGGgjhEAcA9Msm KaubwYcAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMTAtMTZUMTQ6Mzc6MTQrMDA6MDCjoS0GAAAA JXRFWHRkYXRlOm1vZGlmeQAyMDIwLTEwLTE2VDE0OjM3OjE0KzAwOjAw0vyVugAAAABJRU5ErkJg gg== X-Now-Playing: Lamb's _5_: "Last Night the Sky" In-Reply-To: (Robert Pluim's message of "Fri, 16 Oct 2020 10:29:14 +0200") 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" Xref: news.gmane.io gmane.emacs.bugs:190702 Archived-At: Robert Pluim writes: > Search backwards from end-of-buffer for "-- " and then narrow the > buffer from (point-min) to there? Kind of hacky I guess, but otherwise > you'll have to complicate the pcase. I'm fine with complicating the pcase, but I don't really know how to resolve this. A line like "-- " may really be a legitimate diff line, or it may be a signature. If we parsed the file from the top, and we assumed that nobody had edited the patch, then we could see whether the "-- " was outside the patch hunk or not, but the point of the function is to fix up the hunk headers, so that's not really an option, either. So I don't quite know whether this can even be fixed... and it's a real problem, since git format-patch puts a "--" signature at the end, it looks like. But... we could, as a heuristic, guess that if the very first line we see that could belong to a patch looks like "-- ?", then we ignore it. That's probably better than what we have today, where patch destruction is assured. With a hack like that, we'd destroy patches rarely, I think. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no