]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-git: Support `diff-switches'.
authorRüdiger Sonderfeld <ruediger@c-plusplus.net>
Wed, 19 Nov 2014 02:55:00 +0000 (03:55 +0100)
committerRüdiger Sonderfeld <ruediger@c-plusplus.net>
Wed, 19 Nov 2014 11:09:57 +0000 (12:09 +0100)
Fix bug#19099.
* lisp/vc/vc-git.el (vc-git-diff): Use "difftool -x diff" with
  `diff-switches' if `vc-git-diff-switches' is nil.

lisp/ChangeLog
lisp/vc/vc-git.el

index 8b7f62a306e66f2ae4f71bf722e0624c2da4c09c..25ef3b3be7153dad5620ba3ca5bab8aad1627c44 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-19  Rüdiger Sonderfeld  <ruediger@c-plusplus.net>
+
+       Fix bug#19099.
+       * vc/vc-git.el (vc-git-diff): Use "difftool -x diff" with
+       `diff-switches' if `vc-git-diff-switches' is nil.
+
 2014-11-18  Juri Linkov  <juri@linkov.net>
 
        * simple.el (next-line-or-history-element): Wrap next-line
index be0211c11323ebdc6a2130441f69661f47888fff..3b11a3cd6351f3e4b0ddada2c7a6a32904313721 100644 (file)
@@ -994,11 +994,18 @@ or BRANCH^ (where \"^\" can be repeated)."
 (defun vc-git-diff (files &optional rev1 rev2 buffer)
   "Get a difference report using Git between two revisions of FILES."
   (let (process-file-side-effects)
-    (apply #'vc-git-command (or buffer "*vc-diff*") 1 files
-          (if (and rev1 rev2) "diff-tree" "diff-index")
-          "--exit-code"
-          (append (vc-switches 'git 'diff)
-                  (list "-p" (or rev1 "HEAD") rev2 "--")))))
+    (if vc-git-diff-switches
+        (apply #'vc-git-command (or buffer "*vc-diff*") 1 files
+               (if (and rev1 rev2) "diff-tree" "diff-index")
+               "--exit-code"
+               (append (vc-switches 'git 'diff)
+                       (list "-p" (or rev1 "HEAD") rev2 "--")))
+      (vc-git-command (or buffer "*vc-diff*") 1 files
+                      "difftool" "--exit-code" "--no-prompt" "-x"
+                      (concat "diff "
+                              (mapconcat 'identity
+                                         (vc-switches nil 'diff) " "))
+                      (or rev1 "HEAD") rev2 "--"))))
 
 (defun vc-git-revision-table (_files)
   ;; What about `files'?!?  --Stef