bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50761: [PATCH] Do not count git markers as "deleted lines"


From: Konstantin Kharlamov
Subject: bug#50761: [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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]