GNU bug report logs - #50761
[PATCH] Do not count git markers as "deleted lines"

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Thu, 23 Sep 2021 15:41:02 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50761 in the body.
You can then email your comments to 50761 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50761; Package emacs. (Thu, 23 Sep 2021 15:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Konstantin Kharlamov <Hi-Angel <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 23 Sep 2021 15:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Do not count git markers as "deleted lines"
Date: Thu, 23 Sep 2021 18:39:42 +0300
* lisp/vc/diff-mode.el (diff-fixup-modifs): skip "end of patch" markers
that `git-format-patch` leaves around.
---
 lisp/vc/diff-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 0852f8790e9..75bb4dee1ae 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1355,7 +1355,10 @@ diff-fixup-modifs
 	      (pcase (char-after)
 		(?\s (cl-incf space))
 		(?+ (cl-incf plus))
-		(?- (cl-incf minus))
+		(?- (unless ;; in git diff "^-- $" signifies end of patch
+			(and (eq diff-buffer-type 'git)
+			     (looking-at "^-- $"))
+		      (cl-incf minus)))
 		(?! (cl-incf bang))
 		((or ?\\ ?#) nil)
 		(?\n (if diff-valid-unified-empty-line
-- 
2.33.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50761; Package emacs. (Thu, 23 Sep 2021 21:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 50761 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
Cc: 50761 <at> debbugs.gnu.org
Subject: Re: bug#50761: [PATCH] Do not count git markers as "deleted lines"
Date: Thu, 23 Sep 2021 23:26:05 +0200
Konstantin Kharlamov <Hi-Angel <at> yandex.ru> writes:

> * lisp/vc/diff-mode.el (diff-fixup-modifs): skip "end of patch" markers
> that `git-format-patch` leaves around.

Looks good to me, so I've pushed it to Emacs 28 (with a change in the
comment).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50761 <at> debbugs.gnu.org and Konstantin Kharlamov <Hi-Angel <at> yandex.ru> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 23 Sep 2021 21:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Oct 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 187 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.