GNU bug report logs - #35624
log-view-diff regression

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 7 May 2019 22:02:02 UTC

Severity: normal

Tags: patch

Found in version 26.1

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 35624 <at> debbugs.gnu.org
Subject: Re: bug#35624: log-view-diff regression
Date: Wed, 08 May 2019 22:52:41 +0300
> I think the patch should look like the one below instead. Does it fix your
> problem? It also looks "obviously correct" in my opinion.

This is exactly what was my initial thought, but this is a wrong fix,
as I realized later.

> diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
> index e47fad8908..e1e453115b 100644
> --- a/lisp/vc/log-view.el
> +++ b/lisp/vc/log-view.el
> @@ -621,7 +621,8 @@ log-view-diff-common
>                (>= (point)
>                    (save-excursion
>                      (goto-char (car fr-entry))
> -                    (forward-line))))
> +                    (forward-line)
> +                    (point))))
>        (setq fr (vc-call-backend log-view-vc-backend 'previous-revision nil fr)))
>      (vc-diff-internal
>       t (list log-view-vc-backend

This patch doesn't check if the region's end is after the last revision,
also fails if the summary line is expanded to multiline revision's header/body.

> Your proposal would fail in the presence of "Show 2X entries" (when the log
> is long enough).

Yes, I know my previous patch is not perfect, I also tried

  (not (re-search-forward log-view-message-re nil t))

but it seems this is impossible to do because currently
log-view.el doesn't support the notion of the end of
the last revision expanded body.  For example,

1. with the expanded last visible revision

  * h8..: 2019-05-08 Revision h8.
b * g7..: 2019-05-07 Revision g7.
  * f6..: 2019-05-06 Revision f6.
  * e5..: 2019-05-05 Revision e5.
  commit e5
  Date:   2019-05-05
  first line
  second line
e third line

should compare e5 and g7

2. but when region's end (e) is after the last line
   of the last expanded revision:

  * h8..: 2019-05-08 Revision h8.
b * g7..: 2019-05-07 Revision g7.
  * f6..: 2019-05-06 Revision f6.
  * e5..: 2019-05-05 Revision e5.
  commit e5
  Date:   2019-05-05
  first line
  second line
  third line
e

should compare d4 (a previous revision of the last revision) and g7.




This bug report was last modified 5 years and 337 days ago.

Previous Next


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