[Top][All Lists]

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

23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git

From: Eric Hanchrow
Subject: 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git
Date: Sat, 02 Feb 2008 16:51:39 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

I just did C-x v = on some (git-controlled) file on which I'd lightly
hacked, and was surprised to see a lot of output, most of it displaying
sections of the file that I didn't recall touching.  Turns out I've told
Emacs to strip trailing whitespace upon saving, and that's what I was
seeing.  But I wanted to just see the edits I made intentionally, so I
easily enough found the --ignore-space-change option to git-diff.  What
I didn't find was a way to get Emacs to _use_ that option.  What I
finally did was

    diff --git a/lisp/vc-git.el b/lisp/vc-git.el
    index 7920fec..3d4197f 100644
    --- a/lisp/vc-git.el
    +++ b/lisp/vc-git.el
    @@ -324,9 +324,9 @@ or BRANCH^ (where \"^\" can be repeated)."
     (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"
    +        (vc-git-command buf 1 files "diff-tree" "--exit-code" 
"--ignore-space-change" "-p"
                             rev1 rev2 "--")
    -      (vc-git-command buf 1 files "diff-index" "--exit-code" "-p"
    +      (vc-git-command buf 1 files "diff-index" "--exit-code" 
"--ignore-space-change" "-p"
                           (or rev1 "HEAD") "--"))))

     (defun vc-git-revision-table (files)

... which of course is a total crock, despite it happening to please me
at the moment.

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).


    Eric: your commit logs appear to be coming from 
            Author: esr <esr>
    I assume that means you need to configure some dot file somewhere.

None of the ... actors do anything we couldn't do if we looked
like them.
        -- Roger Ebert, reviewing "The Chronicles Of Riddick"

reply via email to

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