]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc-git.el (vc-git-print-log): Restrict file scope to a single file
authorJuri Linkov <juri@linkov.net>
Sun, 4 Feb 2018 21:58:37 +0000 (23:58 +0200)
committerJuri Linkov <juri@linkov.net>
Sun, 4 Feb 2018 21:58:37 +0000 (23:58 +0200)
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'.

etc/NEWS
lisp/vc/vc-git.el

index 02385d2b70df239985545fda36d26028059bb84d..00ff9cda8efbb146cfeb414e835cec8ad17d1225 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1169,6 +1169,9 @@ branch-related commands on a keymap bound to 'B'.
 *** 'vc-region-history' is now bound to 'C-x v h', replacing the older
 'vc-insert-headers' binding.
 
+*** New user option 'vc-git-print-log-follow' to follow renames in Git logs
+for a single file.
+
 ** CC mode
 
 ---
index 3bf837caaa8b90c93848614a6b0fbf3289c8447f..40aa0b26010b64ac6dfbcd6c778c6e98754b6ca4 100644 (file)
@@ -994,7 +994,7 @@ This prompts for a branch to merge from."
 (autoload 'vc-setup-buffer "vc-dispatcher")
 
 (defcustom vc-git-print-log-follow nil
-  "If true, follow renames in Git logs for files."
+  "If true, follow renames in Git logs for a single file."
   :type 'boolean
   :version "26.1")
 
@@ -1019,8 +1019,10 @@ If LIMIT is non-nil, show no more than this many entries."
               (append
                '("log" "--no-color")
                 (when (and vc-git-print-log-follow
-                           (not (cl-some #'file-directory-p files)))
-                  ;; "--follow" on directories is broken
+                           (null (cdr files))
+                           (car files)
+                           (not (file-directory-p (car files))))
+                  ;; "--follow" on directories or multiple files is broken
                   ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756
                   ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16422
                   (list "--follow"))