GNU bug report logs - #28466
26.0.50; diff in vc-outgoing doesn't work properly

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Fri, 15 Sep 2017 04:35:02 UTC

Severity: normal

Found in version 26.0.50

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tom Tromey <tom <at> tromey.com>
To: Tom Tromey <tom <at> tromey.com>
Cc: 28466 <at> debbugs.gnu.org
Subject: bug#28466: 26.0.50; diff in vc-outgoing doesn't work properly
Date: Sat, 16 Sep 2017 15:53:57 -0600
Tom> I was expecting to see a diff showing the combined contents of all 3 of
Tom> my outgoing patches.

Tom> However, the generated diff is missing the oldest patch in the series.

The appended patch fixes this for me.
I'll put it on the Emacs 26 branch after a few days, unless there are
comments.

Tom

diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 52f56ed..d6963d0 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -608,10 +608,16 @@ log-view-diff-changeset
     (log-view-diff-common beg end t)))
 
 (defun log-view-diff-common (beg end &optional whole-changeset)
-  (let ((to (log-view-current-tag beg))
-        (fr (log-view-current-tag end)))
-    (when (string-equal fr to)
-      ;; TO and FR are the same, look at the previous revision.
+  (let* ((to (log-view-current-tag beg))
+         (fr-entry (log-view-current-entry end))
+         (fr (cadr fr-entry)))
+    ;; When TO and FR are the same, or when point is on a line after
+    ;; the last entry, look at the previous revision.
+    (when (or (string-equal fr to)
+              (>= (point)
+                  (save-excursion
+                    (goto-char (car fr-entry))
+                    (forward-line))))
       (setq fr (vc-call-backend log-view-vc-backend 'previous-revision nil fr)))
     (vc-diff-internal
      t (list log-view-vc-backend




This bug report was last modified 7 years and 250 days ago.

Previous Next


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