aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAlexandre Julliard <julliard@winehq.org>2007-08-11 12:22:47 +0200
committerJunio C Hamano <gitster@pobox.com>2007-08-13 12:58:38 -0700
commit09afcd6933e8497c997205dda71d718e62b4de62 (patch)
tree014d0930f241e4aed1f65ed5a814c53d8776cf2d /contrib
parent04d70bebe72c264a1c4d26cbe306672e3e4098e3 (diff)
downloadgit-09afcd6933e8497c997205dda71d718e62b4de62.tar.gz
git-09afcd6933e8497c997205dda71d718e62b4de62.tar.xz
git.el: Add support for interactive diffs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/emacs/git.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index f6102fc34..214b75cf9 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -965,7 +965,13 @@ Return the list of files that haven't been handled."
(defun git-diff-file-idiff ()
"Perform an interactive diff on the current file."
(interactive)
- (error "Interactive diffs not implemented yet."))
+ (let ((files (git-marked-files-state 'added 'deleted 'modified)))
+ (unless (eq 1 (length files))
+ (error "Cannot perform an interactive diff on multiple files."))
+ (let* ((filename (car (git-get-filenames files)))
+ (buff1 (find-file-noselect filename))
+ (buff2 (git-run-command-buffer (concat filename ".~HEAD~") "cat-file" "blob" (concat "HEAD:" filename))))
+ (ediff-buffers buff1 buff2))))
(defun git-log-file ()
"Display a log of changes to the marked file(s)."