GNU bug report logs - #19099
Diff options with vc-git

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 18 Nov 2014 19:10:02 UTC

Severity: normal

Found in version 24.4

Done: RĂ¼diger Sonderfeld <ruediger <at> c-plusplus.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: RĂ¼diger Sonderfeld <ruediger <at> c-plusplus.net>
To: 19099 <at> debbugs.gnu.org
Subject: bug#19099: [PATCH] vc-git: Support `diff-switches'.
Date: Wed, 19 Nov 2014 04:03:17 +0100
This patch should add support for it.  Please check if it works for you.

ChangeLog:

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/vc/vc-git.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index be0211c..3b11a3c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -994,11 +994,18 @@ (autoload 'vc-switches "vc")
 (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
-- 
2.1.3





This bug report was last modified 10 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.