emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp vc-git.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp vc-git.el
Date: Wed, 26 Nov 2008 02:55:28 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/11/26 02:55:28

Modified files:
        lisp           : vc-git.el 

Log message:
        (vc-git-diff-switches): New option.
        (vc-git-diff): Apply diff switches.  (Bug#1386)
        Give it a basic doc string.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-git.el?cvsroot=emacs&r1=1.74&r2=1.75

Patches:
Index: vc-git.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-git.el,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- vc-git.el   27 Oct 2008 07:21:47 -0000      1.74
+++ vc-git.el   26 Nov 2008 02:55:28 -0000      1.75
@@ -109,6 +109,19 @@
   (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,12 +514,12 @@
   (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") "--"))))
+  "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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]