Yann Hodique <[email protected]> writes:

>
> Hi George,
>
> I don't have any objection about the new names, and the concern seems
> valid to me. But it would be better not to let the old names disappear
> without notice as it might break user code.
>
> Can you provide an updated patch that would define the old names with
> `define-obsolete-function-alias' ?
>

Yo!
Sure I can!

From: George Kadianakis <[email protected]>

Rename magit-display-log* commands to magit-log.

---
This patch renames magit-display-log* functions to magit-log*.
It also declares the old magit-display-log* commands as obsolete,
as Yann Hodique suggested.

I'm not good with mnemonics and having magit functions be according to
git(1) helps me a lot. Generally, magit tends to be consistent on this
(magit-show, magit-checkout, magit-diff, etc.), but that was not the
case for git-log commands.

 magit-key-mode.el |    4 ++--
 magit.el          |   10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/magit-key-mode.el b/magit-key-mode.el
index f7c6e2e..7cc5d0f 100644
--- a/magit-key-mode.el
+++ b/magit-key-mode.el
@@ -21,10 +21,10 @@
   '((logging
      (man-page "git-log")
      (actions
-      ("l" "Short" magit-display-log)
+      ("l" "Short" magit-log)
       ("L" "Long" magit-log-long)
       ("h" "Reflog" magit-reflog)
-      ("rl" "Ranged short" magit-display-log-ranged)
+      ("rl" "Ranged short" magit-log-ranged)
       ("rL" "Ranged long" magit-log-long-ranged)
       ("rh" "Ranged reflog" magit-reflog-ranged))
      (switches
diff --git a/magit.el b/magit.el
index 3e0c014..c736250 100644
--- a/magit.el
+++ b/magit.el
@@ -2063,7 +2063,7 @@ function can be enriched by magit extension like magit-topgit and magit-svn"
     ["Diff working tree" magit-diff-working-tree t]
     ["Diff" magit-diff t]
     ("Log"
-     ["Short Log" magit-display-log t]
+     ["Short Log" magit-log t]
      ["Long Log" magit-log-long t]
      ["Reflog" magit-reflog t]
      ["Extended..." magit-key-mode-popup-logging t])
@@ -4362,11 +4362,12 @@ With a non numeric prefix ARG, show all entries"
 (defvar magit-log-grep-buffer-name "*magit-grep-log*"
   "Buffer name for display of log grep results.")
 
-(magit-define-command display-log-ranged ()
+(magit-define-command log-ranged ()
   (interactive)
-  (magit-display-log t))
+  (magit-log t))
+(define-obsolete-function-alias 'magit-display-log-ranged 'magit-log-ranged)
 
-(magit-define-command display-log (&optional ask-for-range &rest extra-args)
+(magit-define-command log (&optional ask-for-range &rest extra-args)
   (interactive)
   (let* ((log-range (if ask-for-range
                         (magit-read-rev-range "Log" "HEAD")
@@ -4379,6 +4380,7 @@ With a non numeric prefix ARG, show all entries"
     (magit-mode-init topdir 'log #'magit-refresh-log-buffer log-range
 		     "--pretty=oneline" args)
     (magit-log-mode t)))
+(define-obsolete-function-alias 'magit-display-log 'magit-log)
 
 (magit-define-command log-long-ranged ()
   (interactive)
-- 
1.7.4.4

Reply via email to