emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8663fad: add `vc-git-print-log-follow' and use it i


From: Sam Steingold
Subject: [Emacs-diffs] master 8663fad: add `vc-git-print-log-follow' and use it in `vc-git-print-log'
Date: Tue, 15 Nov 2016 04:38:10 +0000 (UTC)

branch: master
commit 8663fad0a70e60e130ae4cd0529ead66fbad2250
Author: Sam Steingold <address@hidden>
Commit: Sam Steingold <address@hidden>

    add `vc-git-print-log-follow' and use it in `vc-git-print-log'
    
    When `vc-git-print-log-follow' is true and all files are
    non-directory, pass "--follow" to "git log".
    This works around bug#8756 and bug#16422.
---
 lisp/vc/vc-git.el |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 6d451be..9df581d 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -886,6 +886,11 @@ 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."
+  :type 'boolean
+  :version "26.1")
+
 (defun vc-git-print-log (files buffer &optional shortlog start-revision limit)
   "Print commit log associated with FILES into specified BUFFER.
 If SHORTLOG is non-nil, use a short format based on `vc-git-root-log-format'.
@@ -905,7 +910,13 @@ If LIMIT is non-nil, show no more than this many entries."
        (apply 'vc-git-command buffer
               'async files
               (append
-               '("log" "--no-color" "--follow")
+               '("log" "--no-color")
+                (when (and vc-git-print-log-follow
+                           (not (cl-some #'file-directory-p files)))
+                  ;; "--follow" on directories is broken
+                  ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=8756
+                  ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16422
+                  (list "--follow"))
                (when shortlog
                  `("--graph" "--decorate" "--date=short"
                     ,(format "--pretty=tformat:%s"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]