unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git
@ 2008-02-03  0:51 Eric Hanchrow
  2008-02-03  4:07 ` Thien-Thi Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Hanchrow @ 2008-02-03  0:51 UTC (permalink / raw)
  To: emacs-pretest-bug

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

Thanks.

    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"




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-03  7:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-03  0:51 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git Eric Hanchrow
2008-02-03  4:07 ` Thien-Thi Nguyen
2008-02-03  7:31   ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).