diff options
| author | Glenn Morris | 2008-11-26 02:55:28 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-11-26 02:55:28 +0000 |
| commit | a0bea999eae2f7f0d61fbdda6535fa221524db9b (patch) | |
| tree | 8890db3ad2818a3264937b1399d05546e4bd9478 | |
| parent | 8a44bdf3e43ec57443df31d56f33ad97ab672511 (diff) | |
| download | emacs-a0bea999eae2f7f0d61fbdda6535fa221524db9b.tar.gz emacs-a0bea999eae2f7f0d61fbdda6535fa221524db9b.zip | |
(vc-git-diff-switches): New option.
(vc-git-diff): Apply diff switches. (Bug#1386)
Give it a basic doc string.
| -rw-r--r-- | lisp/vc-git.el | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 51ccc5de856..f024144bb67 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el | |||
| @@ -109,6 +109,19 @@ | |||
| 109 | (require 'vc-dir) | 109 | (require 'vc-dir) |
| 110 | (require 'grep)) | 110 | (require 'grep)) |
| 111 | 111 | ||
| 112 | (defcustom vc-git-diff-switches t | ||
| 113 | "String or list of strings specifying extra switches for Git diff under VC. | ||
| 114 | If nil, use the value of `vc-diff-switches'. | ||
| 115 | If you want to force an empty list of arguments, use t." | ||
| 116 | :type '(choice (const :tag "Unspecified" nil) | ||
| 117 | (const :tag "None" t) | ||
| 118 | (string :tag "Argument String") | ||
| 119 | (repeat :tag "Argument List" | ||
| 120 | :value ("") | ||
| 121 | string)) | ||
| 122 | :version "23.1" | ||
| 123 | :group 'vc) | ||
| 124 | |||
| 112 | (defvar git-commits-coding-system 'utf-8 | 125 | (defvar git-commits-coding-system 'utf-8 |
| 113 | "Default coding system for git commits.") | 126 | "Default coding system for git commits.") |
| 114 | 127 | ||
| @@ -501,12 +514,12 @@ or BRANCH^ (where \"^\" can be repeated)." | |||
| 501 | (beginning-of-line)) | 514 | (beginning-of-line)) |
| 502 | 515 | ||
| 503 | (defun vc-git-diff (files &optional rev1 rev2 buffer) | 516 | (defun vc-git-diff (files &optional rev1 rev2 buffer) |
| 504 | (let ((buf (or buffer "*vc-diff*"))) | 517 | "Get a difference report using Git between two revisions of FILES." |
| 505 | (if (and rev1 rev2) | 518 | (apply #'vc-git-command (or buffer "*vc-diff*") 1 files |
| 506 | (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" | 519 | (if (and rev1 rev2) "diff-tree" "diff-index") |
| 507 | rev1 rev2 "--") | 520 | "--exit-code" |
| 508 | (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" | 521 | (append (vc-switches (if vc-git-diff-switches 'git) 'diff) |
| 509 | (or rev1 "HEAD") "--")))) | 522 | (list "-p" (or rev1 "HEAD") rev2 "--")))) |
| 510 | 523 | ||
| 511 | (defun vc-git-revision-table (files) | 524 | (defun vc-git-revision-table (files) |
| 512 | ;; What about `files'?!? --Stef | 525 | ;; What about `files'?!? --Stef |