Skip to content

Commit 82db17d

Browse files
committed
Publicize behavior of log-view-diff at beginning/end of active region
* lisp/vc/log-view.el (log-view-diff, log-view-diff-changeset): * doc/emacs/maintaining.texi (VC Change Log): Document behavior of log-view-diff at the beginning and the end of the log buffer when the region is active. (Bug#35624) * lisp/vc/vc-git.el (vc-git-print-log): Insert newline at the beginning to enable the feature of diffing with the working revision.
1 parent 1b2b136 commit 82db17d

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

doc/emacs/maintaining.texi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ systems support modifying change comments.
10331033
Visit the revision indicated at the current line.
10341034

10351035
@item d
1036+
@itemx =
10361037
Display a diff between the revision at point and the next earlier
10371038
revision, for the specific file.
10381039

@@ -1047,6 +1048,16 @@ L}), toggle between showing and hiding the full log entry for the
10471048
revision at point.
10481049
@end table
10491050

1051+
To compare two arbitrary revisions, activate the region: set the
1052+
beginning of the region to the line with the first revision and the
1053+
end of the region to the line with the second revision to compare,
1054+
then type @kbd{d} or @kbd{=}. When the beginning of the region is on
1055+
the top line that has no revision, it uses the current working revision
1056+
as the first revision to compare. When the end of the region is on
1057+
the bottom non-revision line after the last revision line, then it
1058+
uses the next earlier revision after the last displayed revision as
1059+
the second revision to compare.
1060+
10501061
@vindex vc-log-show-limit
10511062
Because fetching many log entries can be slow, the
10521063
@file{*vc-change-log*} buffer displays no more than 2000 revisions by

lisp/vc/log-view.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,13 @@ point, get the diff between the revision at point and its
585585
previous revision. Otherwise, get the diff between the revisions
586586
where the region starts and ends.
587587
588+
When the beginning of the region is on the top line that has no revision,
589+
use the current working revision as the first revision to compare.
590+
591+
When the end of the region is on the bottom non-revision line after
592+
the last revision line, use the previous revision of the last
593+
displayed revision as the second revision to compare.
594+
588595
Unlike `log-view-diff-changeset', this function only shows the
589596
part of the changeset which affected the currently considered
590597
file(s)."
@@ -600,6 +607,13 @@ point, get the diff between the revision at point and its
600607
previous revision. Otherwise, get the diff between the revisions
601608
where the region starts and ends.
602609
610+
When the beginning of the region is on the top line that has no revision,
611+
use the current working revision as the first revision to compare.
612+
613+
When the end of the region is on the bottom non-revision line after
614+
the last revision line, use the previous revision of the last
615+
displayed revision as the second revision to compare.
616+
603617
Unlike `log-view-diff' this function shows the whole changeset,
604618
including changes affecting other files than the currently
605619
considered file(s)."

lisp/vc/vc-git.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,8 +1017,8 @@ If LIMIT is a revision string, use it as an end-revision."
10171017
;; If the buffer exists from a previous invocation it might be
10181018
;; read-only.
10191019
(let ((inhibit-read-only t))
1020-
(with-current-buffer
1021-
buffer
1020+
(with-current-buffer buffer
1021+
(insert "\n")
10221022
(apply 'vc-git-command buffer
10231023
'async files
10241024
(append

0 commit comments

Comments
 (0)