aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-02-04 23:58:37 +0200
committerJuri Linkov2018-02-04 23:58:37 +0200
commitc787a4968273027960a20ced6d63bae0d1ffa87e (patch)
treefd9e153058526fd135c147a85f3c3d861cc0027e
parentb654791064b43a94150ed6c56053162a6b2ea037 (diff)
downloademacs-c787a4968273027960a20ced6d63bae0d1ffa87e.tar.gz
emacs-c787a4968273027960a20ced6d63bae0d1ffa87e.zip
* lisp/vc/vc-git.el (vc-git-print-log): Restrict file scope to a single file
when vc-git-print-log-follow is non-nil (bug#19045). (vc-git-print-log-follow): Doc fix. * etc/NEWS: Mention 'vc-git-print-log-follow'.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/vc/vc-git.el8
2 files changed, 8 insertions, 3 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 02385d2b70d..00ff9cda8ef 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1169,6 +1169,9 @@ branch-related commands on a keymap bound to 'B'.
1169*** 'vc-region-history' is now bound to 'C-x v h', replacing the older 1169*** 'vc-region-history' is now bound to 'C-x v h', replacing the older
1170'vc-insert-headers' binding. 1170'vc-insert-headers' binding.
1171 1171
1172*** New user option 'vc-git-print-log-follow' to follow renames in Git logs
1173for a single file.
1174
1172** CC mode 1175** CC mode
1173 1176
1174--- 1177---
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3bf837caaa8..40aa0b26010 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -994,7 +994,7 @@ This prompts for a branch to merge from."
994(autoload 'vc-setup-buffer "vc-dispatcher") 994(autoload 'vc-setup-buffer "vc-dispatcher")
995 995
996(defcustom vc-git-print-log-follow nil 996(defcustom vc-git-print-log-follow nil
997 "If true, follow renames in Git logs for files." 997 "If true, follow renames in Git logs for a single file."
998 :type 'boolean 998 :type 'boolean
999 :version "26.1") 999 :version "26.1")
1000 1000
@@ -1019,8 +1019,10 @@ If LIMIT is non-nil, show no more than this many entries."
1019 (append 1019 (append
1020 '("log" "--no-color") 1020 '("log" "--no-color")
1021 (when (and vc-git-print-log-follow 1021 (when (and vc-git-print-log-follow
1022 (not (cl-some #'file-directory-p files))) 1022 (null (cdr files))
1023 ;; "--follow" on directories is broken 1023 (car files)
1024 (not (file-directory-p (car files))))
1025 ;; "--follow" on directories or multiple files is broken
1024 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756 1026 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756
1025 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16422 1027 ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16422
1026 (list "--follow")) 1028 (list "--follow"))