GNU bug report logs - #1386
23.0.60; vc-git-diff: diff switches can't be customized

Previous Next

Package: emacs;

Reported by: Magnus Henoch <mange <at> freemail.hu>

Date: Thu, 20 Nov 2008 01:00:03 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #6 received at 1386 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Magnus Henoch <mange <at> freemail.hu>
Cc: 1386 <at> debbugs.gnu.org
Subject: Re: bug#1386: 23.0.60; vc-git-diff: diff switches can't be customized
Date: Fri, 21 Nov 2008 14:37:50 -0500
Magnus Henoch wrote:

> I then found that vc-git-diff doesn't obey _any_ of diff-switches,
> vc-diff-switches and vc-git-diff-switches, though the docstring of
> vc-diff-switches implies that it would.


Sorry for the long delay. Please try this patch.


*** vc-git.el	27 Oct 2008 07:21:47 -0000	1.74
--- vc-git.el	21 Nov 2008 19:32:55 -0000
***************
*** 109,114 ****
--- 109,127 ----
    (require 'vc-dir)
    (require 'grep))
  
+ (defcustom vc-git-diff-switches t
+   "String or list of strings specifying extra switches for Git diff under VC.
+ If nil, use the value of `vc-diff-switches'.
+ If you want to force an empty list of arguments, use t."
+   :type '(choice (const :tag "Unspecified" nil)
+ 		 (const :tag "None" t)
+ 		 (string :tag "Argument String")
+ 		 (repeat :tag "Argument List"
+ 			 :value ("")
+ 			 string))
+   :version "23.1"
+   :group 'vc)
+ 
  (defvar git-commits-coding-system 'utf-8
    "Default coding system for git commits.")
  
***************
*** 501,512 ****
    (beginning-of-line))
  
  (defun vc-git-diff (files &optional rev1 rev2 buffer)
!   (let ((buf (or buffer "*vc-diff*")))
!     (if (and rev1 rev2)
!         (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p"
!                         rev1 rev2 "--")
!       (vc-git-command buf 1 files "diff-index" "--exit-code" "-p"
!                       (or rev1 "HEAD") "--"))))
  
  (defun vc-git-revision-table (files)
    ;; What about `files'?!?  --Stef
--- 514,525 ----
    (beginning-of-line))
  
  (defun vc-git-diff (files &optional rev1 rev2 buffer)
!   "Get a difference report using Git between two revisions of FILES."
!   (apply #'vc-git-command (or buffer "*vc-diff*") 1 files
! 	 (if (and rev1 rev2) "diff-tree" "diff-index")
! 	 "--exit-code"
! 	 (append (vc-switches (if vc-git-diff-switches 'git) 'diff)
! 		 (list "-p" (or rev1 "HEAD") rev2 "--"))))
  
  (defun vc-git-revision-table (files)
    ;; What about `files'?!?  --Stef




This bug report was last modified 15 years and 202 days ago.

Previous Next


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