From: "Rüdiger Sonderfeld" <ruediger@c-plusplus.net>
To: 19099@debbugs.gnu.org
Subject: bug#19099: [PATCH] vc-git: Support `diff-switches'.
Date: Wed, 19 Nov 2014 04:03:17 +0100 [thread overview]
Message-ID: <2391043.JvtrDuf8fR@descartes> (raw)
In-Reply-To: <mjoas4mike.fsf@fencepost.gnu.org>
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
next prev parent reply other threads:[~2014-11-19 3:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 19:09 bug#19099: Diff options with vc-git Glenn Morris
2014-11-18 19:17 ` Eli Zaretskii
2014-11-18 19:27 ` Glenn Morris
2014-11-18 19:57 ` Eli Zaretskii
2014-11-18 20:01 ` Eli Zaretskii
2014-11-19 3:03 ` Rüdiger Sonderfeld [this message]
2014-11-19 4:36 ` bug#19099: [PATCH] vc-git: Support `diff-switches' Glenn Morris
2014-11-19 11:13 ` Rüdiger Sonderfeld
2014-11-19 18:30 ` Glenn Morris
2014-11-19 19:05 ` Eli Zaretskii
2014-11-19 19:44 ` Glenn Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2391043.JvtrDuf8fR@descartes \
--to=ruediger@c-plusplus.net \
--cc=19099@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.