Subject: Re: bug#17945: 24.4.50; vc-git-annotate-command is too slow

From: Óscar Fuentes <[email-masked]>
Date: Tue, 24 Feb 2015 16:31:45 +0100

So what about this patch?

	Modified   lisp/vc/vc-git.el
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index a31c121..07ff083 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -120,6 +120,16 @@ (defcustom vc-git-diff-switches t
   :version "23.1"
   :group 'vc-git)
 
+(defcustom vc-git-annotate-switches t
+  "String or list of strings specifying switches for Git blame under VC.
+If nil, use the value of `vc-annotate-switches'.  If t, use no switches."
+  :type '(choice (const :tag "Unspecified" nil)
+		 (const :tag "None" t)
+		 (string :tag "Argument String")
+		 (repeat :tag "Argument List" :value ("") string))
+  :version "25.1"
+  :group 'vc-git)
+
 (defcustom vc-git-program "git"
   "Name of the Git executable (excluding any arguments)."
   :version "24.1"
@@ -1013,7 +1023,9 @@ (defun vc-git-revision-completion-table (files)
 
 (defun vc-git-annotate-command (file buf &optional rev)
   (let ((name (file-relative-name file)))
-    (vc-git-command buf 'async nil "blame" "--date=iso" "-C" "-C" rev "--" name)))
+    (apply #'vc-git-command buf 'async nil "blame" "--date=iso"
+	   (append (vc-switches 'git 'annotate)
+		   (list rev "--" name)))))
 
 (declare-function vc-annotate-convert-time "vc-annotate" (time))