[PATCH] [TRIVIAL] Use HEAD as the default range start of magit-diff.

39 views
Skip to first unread message

George Kadianakis

unread,
Jun 15, 2011, 10:55:15 PM6/15/11
to ma...@googlegroups.com
---
Continuing with another uber-trivial patch; this one uses HEAD as the
default range beginning of magit-diff. It's currently empty which is
unhelpful. I use magit-diff with HEAD a lot and this patch has been
hanging in my local setup for a while and maybe it's useful for
someone else as well.

magit.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/magit.el b/magit.el
index d049fe4..e4f03aa 100644
--- a/magit.el
+++ b/magit.el
@@ -4570,7 +4570,7 @@ restore the window state that was saved before
ediff was called."
:keymap magit-diff-mode-map)

(magit-define-command diff (range)
- (interactive (list (magit-read-rev-range "Diff")))
+ (interactive (list (magit-read-rev-range "Diff" "HEAD")))
(if range
(let* ((dir default-directory)
(args (magit-rev-range-to-git range))
--
1.7.5.3

Felipe

unread,
May 25, 2013, 11:53:30 AM5/25/13
to ma...@googlegroups.com, desn...@gmail.com
Since this patch has (AFAICT) not made it in, here is the same thing rewritten into a defadvice than can be dropped into your .emacs;


(defadvice magit-diff (before magit-diff-default-to-head activate)
  "Offer HEAD as first default for magit-diff"
  (interactive (list (magit-read-rev-range "Diff" "HEAD"))))
Reply all
Reply to author
Forward
0 new messages