From: Eric Hanchrow <offby1@blarg.net>
To: emacs-pretest-bug@gnu.org
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 [thread overview]
Message-ID: <87sl0auajo.fsf@offby1.atm01.sea.blarg.net> (raw)
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"
next reply other threads:[~2008-02-03 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-03 0:51 Eric Hanchrow [this message]
2008-02-03 4:07 ` 23.0.60; Suggestion for vc-git.el: allow me to specify options to vc-git Thien-Thi Nguyen
2008-02-03 7:31 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sl0auajo.fsf@offby1.atm01.sea.blarg.net \
--to=offby1@blarg.net \
--cc=emacs-pretest-bug@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.