el/dot-emacs.el: Add a `reverse-diff' option to Magit's diff popups.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 15 Jul 2017 00:13:05 +0000 (01:13 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 15 Jul 2017 00:13:05 +0000 (01:13 +0100)
This is just what you need for comparing the working tree to some target
revision, when tidying up a patch queue or a working-tree disaster.
It's essentially the missing bit of Magit's old rewrite mode.

el/dot-emacs.el

index cd8b407..80fc05a 100644 (file)
@@ -3678,7 +3678,12 @@ This allows you to pass a list of arguments through `ansi-term'."
          (magit-wip-after-save-mode 1)
          (magit-wip-after-apply-mode 1)
          (magit-wip-before-change-mode 1)
-         (add-to-list 'magit-no-confirm 'safe-with-wip)))
+         (add-to-list 'magit-no-confirm 'safe-with-wip)
+         (dolist (popup '(magit-diff-popup
+                          magit-diff-refresh-popup
+                          magit-diff-mode-refresh-popup
+                          magit-revision-mode-refresh-popup))
+           (magit-define-popup-switch popup ?R "Reverse diff" "-R"))))
 
 (setq magit-repolist-columns
       '(("Name" 16 magit-repolist-column-ident nil)