Skip to content

Commit

Permalink
git.el: Add support for interactive diffs.
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Alexandre Julliard authored and Junio C Hamano committed Aug 13, 2007
1 parent 04d70be commit 09afcd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
Expand Down

0 comments on commit 09afcd6

Please sign in to comment.