git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git.el: Add support for interactive diffs.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Aug 11, 2007, 10:22 UTC
Message-ID
<87k5s2wetk.fsf@wine.dyndns.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 contrib/emacs/git.el |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index f6102fc..214b75c 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)."
-- 
1.5.3.rc4.70.gf909

-- 
Alexandre Julliard
julliard@winehq.org
Message 1 of 1 in “git.el: Add support for interactive diffs.”
  1. git.el: Add support for interactive diffs.Alexandre Julliard, Aug 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.