{"thread":{"id":"3675","subject":"[PATCH 3/3] git.el: Added a function to diff against the other heads in a merge.","startedAt":"2006-03-19T09:06:10Z","lastAt":"2006-03-19T09:06:10Z","messageCount":1,"participants":["Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"17664","messageId":"87slpeby7x.fsf@wine.dyndns.org","threadId":"3675","inReplyTo":null,"subject":"[PATCH 3/3] git.el: Added a function to diff against the other heads in a merge.","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2006-03-19T09:06:10Z","receivedAt":"2006-03-19T09:06:10Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"git-diff-file-merge-head generates a diff against the first merge\nhead, or with a prefix argument against the nth head. Bound to `d h'\nby default.\n\nSigned-off-by: Alexandre Julliard <julliard@winehq.org>\n\n---\n\n contrib/emacs/git.el |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\n92478446cf5718ee76acaced75ff41416329a509\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 5496a1b..ebd00ef 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -767,6 +767,16 @@ The default is to fall back to the git r\n     (git-setup-diff-buffer\n      (apply #'git-run-command-buffer \"*git-diff*\" \"diff-index\" \"-p\" \"-M\" \"HEAD\" \"--\" (git-get-filenames files)))))\n \n+(defun git-diff-file-merge-head (arg)\n+  \"Diff the marked file(s) against the first merge head (or the nth one with a numeric prefix).\"\n+  (interactive \"p\")\n+  (let ((files (git-marked-files))\n+        (merge-heads (git-get-merge-heads)))\n+    (unless merge-heads (error \"No merge in progress\"))\n+    (git-setup-diff-buffer\n+     (apply #'git-run-command-buffer \"*git-diff*\" \"diff-index\" \"-p\" \"-M\"\n+            (or (nth (1- arg) merge-heads) \"HEAD\") \"--\" (git-get-filenames files)))))\n+\n (defun git-diff-unmerged-file (stage)\n   \"Diff the marked unmerged file(s) against the specified stage.\"\n   (let ((files (git-marked-files)))\n@@ -959,6 +969,7 @@ The default is to fall back to the git r\n     (define-key diff-map \"=\" 'git-diff-file)\n     (define-key diff-map \"e\" 'git-diff-file-idiff)\n     (define-key diff-map \"E\" 'git-find-file-imerge)\n+    (define-key diff-map \"h\" 'git-diff-file-merge-head)\n     (define-key diff-map \"m\" 'git-diff-file-mine)\n     (define-key diff-map \"o\" 'git-diff-file-other)\n     (setq git-status-mode-map map)))\n-- \n1.2.4.g9c5a7\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}