[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 46a2c19: Fix vc-annotate-show-log-revision-at-line
From: |
Dmitry Gutov |
Subject: |
master 46a2c19: Fix vc-annotate-show-log-revision-at-line |
Date: |
Thu, 23 Sep 2021 07:56:34 -0400 (EDT) |
branch: master
commit 46a2c191f2cdda4144dfe7bfce064588f2b2f780
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Fix vc-annotate-show-log-revision-at-line
* lisp/vc/vc-annotate.el (vc-annotate-show-log-revision-at-line):
Stop from being affected by 'vc-git-print-log-follow'.
* lisp/vc/vc-git.el (vc-git-print-log-follow):
Mention caveats in a comment.
---
lisp/vc/vc-annotate.el | 3 +++
lisp/vc/vc-git.el | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index 82531f7..45bb177 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -545,6 +545,7 @@ Return a cons (REV . FILENAME)."
(defvar log-view-vc-backend)
(defvar log-view-vc-fileset)
+(defvar vc-git-print-log-follow)
(defun vc-annotate-show-log-revision-at-line ()
"Visit the log of the revision at line.
@@ -559,6 +560,8 @@ the file in question, search for the log entry required and
move point."
(message "Cannot extract revision number from the current line")
(let ((backend vc-annotate-backend)
(log-buf (get-buffer "*vc-change-log*"))
+ ;; No need to follow renames: we specify the historical file
name.
+ vc-git-print-log-follow
pos)
(if (and
log-buf
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8332600..eca8d54 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1147,6 +1147,14 @@ This prompts for a branch to merge from."
(autoload 'vc-setup-buffer "vc-dispatcher")
+;; It's a weird option due to how Git handles '--follow', and it can
+;; hide certain (usually merge) commits in the `vc-print-log' buffers.
+;;
+;; (setq vc-git-log-switches '("-m")) can fix that, but at the cost of
+;; duplicating many merge commits in the log.
+;;
+;; Long explanation here:
+;;
https://stackoverflow.com/questions/46487476/git-log-follow-graph-skips-commits
(defcustom vc-git-print-log-follow nil
"If true, follow renames in Git logs for a single file."
:type 'boolean
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 46a2c19: Fix vc-annotate-show-log-revision-at-line,
Dmitry Gutov <=