unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50761: [PATCH] Do not count git markers as "deleted lines"
@ 2021-09-23 15:39 Konstantin Kharlamov
  2021-09-23 21:26 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Kharlamov @ 2021-09-23 15:39 UTC (permalink / raw)
  To: 50761

* 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






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#50761: [PATCH] Do not count git markers as "deleted lines"
  2021-09-23 15:39 bug#50761: [PATCH] Do not count git markers as "deleted lines" Konstantin Kharlamov
@ 2021-09-23 21:26 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-23 21:26 UTC (permalink / raw)
  To: Konstantin Kharlamov; +Cc: 50761

Konstantin Kharlamov <Hi-Angel@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-23 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 15:39 bug#50761: [PATCH] Do not count git markers as "deleted lines" Konstantin Kharlamov
2021-09-23 21:26 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).