From unknown Fri Sep 19 18:23:31 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#1536 <1536@debbugs.gnu.org> To: bug#1536 <1536@debbugs.gnu.org> Subject: Status: diff-mode for git patches problem Reply-To: bug#1536 <1536@debbugs.gnu.org> Date: Sat, 20 Sep 2025 01:23:31 +0000 retitle 1536 diff-mode for git patches problem reassign 1536 emacs submitter 1536 Dmitriy Blinov severity 1536 wishlist thanks From bda@mns.spb.ru Thu Dec 11 04:51:40 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0227 Tokens: new, 58; hammy, 29; neutral, 65; spammy, 4. spammytokens:0.998-1--H*M:spb, 0.998-1--H*MI:spb, 0.997-1--H*F:D*spb.ru, 0.987-1--malformed hammytokens:0.000-+--emacs, 0.000-+--diff, 0.001-+--100644, 0.003-3--deletions, 0.004-2--insertions X-Spam-Status: No, score=-6.0 required=4.0 tests=BAYES_05,MURPHY_DRUGS_REL8, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 11 Dec 2008 12:51:40 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBCpamo011635 for ; Thu, 11 Dec 2008 04:51:38 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAl0y-0001fj-G6 for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2008 07:51:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAl0w-0001cr-Ls for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2008 07:51:35 -0500 Received: from [199.232.76.173] (port=46006 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAl0w-0001cU-Ds for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2008 07:51:34 -0500 Received: from mail.mnsspb.ru ([84.204.75.2]:60765) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAl0v-0000hk-Kp for bug-gnu-emacs@gnu.org; Thu, 11 Dec 2008 07:51:34 -0500 Received: from [192.168.0.114] by mail.mnsspb.ru with esmtps id 1LAkzw-0000GO-Rp for ; Thu, 11 Dec 2008 15:50:33 +0300 Message-ID: <49410CA4.8000800@mns.spb.ru> Date: Thu, 11 Dec 2008 15:50:44 +0300 From: Dmitriy Blinov User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: diff-mode for git patches problem Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 There is the problem then I'm trying to edit git-generated patches in emacs diff-mode. git patches look like: --- hello.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hello.txt b/hello.txt index 55bf894..25a09cc 100644 --- a/hello.txt +++ b/hello.txt @@ -6,7 +6,7 @@ 5 6 7 -8 +8 8 9 10 11 -- 1.5.6.5 The last but one line is two minuses by default. And diff-mode recognizes first minus as deleted string. Therefore when we change some strings in patch, emacs creates malformed hunk offset. It will be @@ -6,8 +6,7 @@ insead of correct @@ -6,7 +6,7 @@ after patch edition (if we don't delete/create strings). From rgm@gnu.org Thu Dec 11 10:02:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 23; hammy, 30; neutral, 39; spammy, 0. spammytokens: hammytokens:0.000-+--H*UA:Emacs, 0.000-+--H*r:140.186.70, 0.000-+--H*r:ip*140.186.70.10, 0.000-+--H*r:sk:fencepo, 0.000-+--H*MI:fencepost X-Spam-Status: No, score=-9.8 required=4.0 tests=AWL,BAYES_00,MISSING_SUBJECT, NOSUBJECT,RCVD_IN_DNSWL_MED,VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 11 Dec 2008 18:02:34 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBI2VcQ019350 for ; Thu, 11 Dec 2008 10:02:32 -0800 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1LAprE-0002VH-6e; Thu, 11 Dec 2008 13:01:52 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18753.21904.45243.236603@fencepost.gnu.org> Date: Thu, 11 Dec 2008 13:01:52 -0500 From: Glenn Morris To: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: black X-Ran: wcRW`Bzfn@&;4m9ed\12fM5%Rpv|Fs\p$Xa&>,fVUqRW[Y&Yw>|$um?ulAX9EM=S:o4S#f X-Debbugs-No-Ack: yes merge 1536 1537 From monnier@IRO.UMontreal.CA Fri Dec 12 11:08:30 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 15; hammy, 103; neutral, 39; spammy, 4. spammytokens:0.997-1--formally, 0.997-1--gits, 0.976-7--friendly, 0.866-+--here hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs X-Spam-Status: No, score=-7.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,VALID_BTS_CONTROL autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 12 Dec 2008 19:08:30 +0000 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCJ8LP9005745; Fri, 12 Dec 2008 11:08:23 -0800 Received: from alfajor.home (vpn-132-204-232-87.acd.umontreal.ca [132.204.232.87]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mBCJ8vxx007975; Fri, 12 Dec 2008 14:08:57 -0500 Received: by alfajor.home (Postfix, from userid 20848) id B4B641C13C; Fri, 12 Dec 2008 14:08:19 -0500 (EST) From: Stefan Monnier To: Dmitriy Blinov Cc: 1537@debbugs.gnu.org Subject: Re: bug#1537: diff-mode for git patches trouble Message-ID: References: <494110EB.3040600@mns.spb.ru> <49420B4F.9000902@mns.spb.ru> Date: Fri, 12 Dec 2008 14:08:19 -0500 In-Reply-To: <49420B4F.9000902@mns.spb.ru> (Dmitriy Blinov's message of "Fri, 12 Dec 2008 09:57:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3167=0 severity 1537 wishlist thanks >> Of course, in the general case the problem is insoluble (e.g. if you >> edit the line with the "--"), but clearly we can do better in the >> "normal" case. > Probably it was incorrect to post this feature here. In fact it's git > problem but not emacs. No, it definitely has its place here: while it's true that Git's output is not very friendly to patch-editing as supported by diff-mode, the output is formally correct and unambiguous. And your example of changes is also unambiguous, so you can definitely argue that Emacs should behave correctly in this case. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 16 13:00:12 2020 Received: (at 1536) by debbugs.gnu.org; 16 Aug 2020 17:00:12 +0000 Received: from localhost ([127.0.0.1]:58338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7M0x-0008Aq-LR for submit@debbugs.gnu.org; Sun, 16 Aug 2020 13:00:11 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:33206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k7M0u-0007zH-TY; Sun, 16 Aug 2020 13:00:10 -0400 Received: by mail-yb1-f193.google.com with SMTP id p191so8136426ybg.0; Sun, 16 Aug 2020 10:00:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=K6ojQVl8CkxaBqT/Hxwvyad7RCiKwtIcJWPKxomCg94=; b=CMrccYUtlhQGMkeg7OpzZle9MbhTvjNnaqC+FtG8gvS/zCVG4esPdAYAj7HJxVIzrC 6lh7VKSo/Oi5xqm5KB5LMROCawuXn5/FuHBWAXnYOmAQepmgrJv97/jdJTlbrc+T0n4X OEu3wtiJsO5klZenKN9oj6BLLhPwNU/nl9lf5Zklbllh4ZHKeAQvi1D9SCLYWxEm1MjO JoAJ8cs74RlC3+M8vVMrgLL6LVjOrp1G3jzPyWagdQNxhXCbgGO25QOpxKRPlTBmbIZA 1JDBWZxX4Z6HeYP3x5Z2BkKS1q1uVgBsT/3xJ52HX0u8ivJaUyml3IsOeviiDOA1TbGL AAVw== X-Gm-Message-State: AOAM533zGlSXr3xIvaYQqWoPi3NbJD5VoOkZ6Uf+CW418Su2aX/BkrmR 1WJfImqWSW7MU21a0CopBTip5MBdjdngs7twJRwGJ89rtSQ= X-Google-Smtp-Source: ABdhPJyvk+3tYqVcAw1Smgs1j4yXobk/QQPZE5r7M3c57tuAaBWnc5wJV615XXBgbcWlsmlSbIRTuqQ0mQta4CTkOz8= X-Received: by 2002:a25:9843:: with SMTP id k3mr15964898ybo.466.1597597203228; Sun, 16 Aug 2020 10:00:03 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 16 Aug 2020 10:00:02 -0700 From: Stefan Kangas In-Reply-To: <494110EB.3040600@mns.spb.ru> (Dmitriy Blinov's message of "Thu, 11 Dec 2008 16:08:59 +0300") References: <494110EB.3040600@mns.spb.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Sun, 16 Aug 2020 10:00:02 -0700 Message-ID: Subject: Re: bug#1537: diff-mode for git patches trouble To: Dmitriy Blinov Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 1536 Cc: 1537@debbugs.gnu.org, 1536@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: -0.5 (/) Dmitriy Blinov writes: > There is the problem then I'm trying to edit git-generated patches in > emacs diff-mode. > > git patches look like: > --- > hello.txt | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hello.txt b/hello.txt > index 55bf894..25a09cc 100644 > --- a/hello.txt > +++ b/hello.txt > @@ -6,7 +6,7 @@ > 5 > 6 > 7 > -8 > +8 8 > 9 > 10 > 11 (That was 11 years ago.) I can't reproduce this on current master. The numbers seem to update correctly, as ar as I'm understanding from: https://stackoverflow.com/questions/6508651/what-do-the-numbers-on-a-git-diff-header-mean It would be useful if someone could double check this finding in case there is something I'm missing. It could be quickly verified using: git format-patch -1 ; ./src/emacs -Q *patch And then edit any line in a patch to see if the numbers update correctly. Best regards, Stefan Kangas From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 14 02:08:29 2020 Received: (at 1536) by debbugs.gnu.org; 14 Oct 2020 06:08:29 +0000 Received: from localhost ([127.0.0.1]:49836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZxd-0006bp-Gd for submit@debbugs.gnu.org; Wed, 14 Oct 2020 02:08:29 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZxb-0006ba-Md; Wed, 14 Oct 2020 02:08:28 -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=H36QbzdENo9rVVLJ2Alo9pNH1r8v17Qiv1oHshLJA9I=; b=aSTwHh+OHiWSJkPEjlBCK1Lyf/ vBO9ygiHY0XRLsnLCDPxQAZax+D0LVWqmgKQwjvKnPsGn4H1rGdbtjpTq9SD4kURPtJNYhpUqVjL2 3rRSDcbe3a0kSbk1lJVLg6XPeIzvwePZZeyNAKZXgTjiMhPSYZGYA0jaM6s76CZbW0Js=; 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 1kSZxS-0007oJ-J5; Wed, 14 Oct 2020 08:08:21 +0200 From: Lars Ingebrigtsen To: Stefan Kangas Subject: Re: bug#1536: bug#1537: diff-mode for git patches trouble References: <494110EB.3040600@mns.spb.ru> X-Now-Playing: Hulk's _Silver Thread of Ghosts_: "Elephant Memory" Date: Wed, 14 Oct 2020 08:08:17 +0200 In-Reply-To: (Stefan Kangas's message of "Sun, 16 Aug 2020 10:00:02 -0700") Message-ID: <87a6wp2vce.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Kangas writes: > I can't reproduce this on current master. The numbers seem to update > correctly, as ar as I'm understanding from: > > https://stackoverflow.com/questions/6508651/what-do-the-numbers-on-a-git-diff-h [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 1536 Cc: 1537@debbugs.gnu.org, 1536@debbugs.gnu.org, Dmitriy Blinov 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.0 (-) Stefan Kangas writes: > I can't reproduce this on current master. The numbers seem to update > correctly, as ar as I'm understanding from: > > https://stackoverflow.com/questions/6508651/what-do-the-numbers-on-a-git-diff-header-mean > > It would be useful if someone could double check this finding in case > there is something I'm missing. It could be quickly verified using: > > git format-patch -1 ; ./src/emacs -Q *patch > > And then edit any line in a patch to see if the numbers update correctly. Yup; seems to update correctly for me, too, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 14 02:08:35 2020 Received: (at control) by debbugs.gnu.org; 14 Oct 2020 06:08:35 +0000 Received: from localhost ([127.0.0.1]:49841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZxj-0006cF-39 for submit@debbugs.gnu.org; Wed, 14 Oct 2020 02:08:35 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSZxh-0006bo-Qg for control@debbugs.gnu.org; Wed, 14 Oct 2020 02:08:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yR62JxMddCE0eQuFWFpTZAa7xjXqFQS2drp8qLFefw0=; b=H6MrUviaXp4jjZtgs4LU7jDgE7 57Q87YKdLpguKvCSdjf5nDn3fOuF4aARy7tYNRDFHOISCEngc7s3+KYVrVPhCtszcTi2+c+6vSWIC KKPuSQN+ZFxLpu2TM8Y5UBY9mGNV31P0Jnx0AUNExn6n+4dns8fnBie4usxMSbzkqFTw=; 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 1kSZxZ-0007oV-OV for control@debbugs.gnu.org; Wed, 14 Oct 2020 08:08:28 +0200 Date: Wed, 14 Oct 2020 08:08:24 +0200 Message-Id: <878sc92vc7.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #1536 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 1536 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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.0 (-) close 1536 quit From unknown Fri Sep 19 18:23:31 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 11 Nov 2020 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator