[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc
From: |
Thien-Thi Nguyen |
Subject: |
Re: 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git |
Date: |
Sun, 03 Feb 2008 05:07:21 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
() Eric Hanchrow <address@hidden>
() Sat, 02 Feb 2008 16:51:39 -0800
So: if there isn't already some way I can customize Emacs to do
this, could you add such a way? (I still haven't figured out
if there's a way to simply tell "git" to always pass the
--ignore-space-change option to the diff-tree command).
Below is a revised vc-git-diff from:
http://www.gnuvola.org/wip/ (see vc-git-hacking)
I use it in together w/ the ~/.emacs form:
(setq vc-git-diff-switches "--stat")
Please try it out and let me know how/where it breaks.
You will probably want to use something like:
(setq vc-git-diff-switches '("--stat" "--ignore-space-change"))
If we can get it to behave in many cases, i will install it.
thi
_____________________________________________________________
(defun vc-git-diff (files &optional rev1 rev2 buffer)
"Backend to `vc-diff' for Git.
This respects `vc-git-diff-switches'."
(let ((twop (and rev1 rev2)))
(apply 'vc-git-command (or buffer "*vc-diff*") 1 files
(if twop "diff-tree" "diff-index")
`(,@(vc-switches 'git 'diff)
"--exit-code" "-p"
,@(if twop
(list rev1 rev2)
(list (or rev1 "HEAD")))
"--"))))