From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Newsgroups: gmane.emacs.bugs Subject: bug#19099: [PATCH] vc-git: Support `diff-switches'. Date: Wed, 19 Nov 2014 04:03:17 +0100 Message-ID: <2391043.JvtrDuf8fR@descartes> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1416369749 31014 80.91.229.3 (19 Nov 2014 04:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Nov 2014 04:02:29 +0000 (UTC) To: 19099@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 19 05:02:22 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqwTF-0006p3-W1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Nov 2014 05:02:22 +0100 Original-Received: from localhost ([::1]:56398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqwTF-0005B2-Hc for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Nov 2014 23:02:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqwT4-0005Ae-TH for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 23:02:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqwSx-0008ES-EN for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 23:02:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqwSx-0008EK-CH for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 23:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XqwSw-0003fD-PG for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 23:02:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Nov 2014 04:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19099 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19099-submit@debbugs.gnu.org id=B19099.141636971314062 (code B ref 19099); Wed, 19 Nov 2014 04:02:02 +0000 Original-Received: (at 19099) by debbugs.gnu.org; 19 Nov 2014 04:01:53 +0000 Original-Received: from localhost ([127.0.0.1]:37725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XqwSm-0003ei-ES for submit@debbugs.gnu.org; Tue, 18 Nov 2014 23:01:53 -0500 Original-Received: from ptmx.org ([178.63.28.110]:54145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XqvYM-0002Eu-PD for 19099@debbugs.gnu.org; Tue, 18 Nov 2014 22:03:35 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id CA7AE2CA17; Wed, 19 Nov 2014 04:03:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4DDF030j7g02; Wed, 19 Nov 2014 04:03:30 +0100 (CET) Original-Received: from descartes.localnet (chello080109100138.16.15.univie.teleweb.at [80.109.100.138]) by ptmx.org (Postfix) with ESMTPSA id B20922855C; Wed, 19 Nov 2014 04:03:30 +0100 (CET) User-Agent: KMail/4.13.3 (Linux/3.13.0-39-generic; KDE/4.13.3; x86_64; ; ) X-Mailman-Approved-At: Tue, 18 Nov 2014 23:01:51 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:96215 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