diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2019-04-16 09:22:00 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2019-04-17 19:30:09 +0200 |
| commit | 922e71a3f20de5009d98cc10157d1374059a69c9 (patch) | |
| tree | 85706bdbd82a5238114e6143b8f3b3f5def5e18b /lisp | |
| parent | ab9a5457623e7829f6dce2ed122a483cfc04aa5c (diff) | |
magit-reflog-mode: No longer derive from magit-log-mode
While a reflog can be shown using "git log -g --abbrev-commit
--pretty=online" a reflog is still rather different from a log.
Usually a reflog is shown using "git reflog show", which is an
alias for the mentioned log command and what Magit uses.
This also fixes a bug. Previously when showing the real log for the
reflog entry at point the log arguments were picked up from the reflog
arguments used in the reflog buffer, which is undesirable because that
currently is just "-n256".
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/magit-log.el | 8 | ||||
| -rw-r--r-- | lisp/magit-mode.el | 4 | ||||
| -rw-r--r-- | lisp/magit-reflog.el | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/lisp/magit-log.el b/lisp/magit-log.el index 8690a14..f85d23b 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1023,7 +1023,7 @@ Do not add this to a hook variable." (let ((magit-log-count 0)) (magit-wash-sequence (apply-partially 'magit-log-wash-rev style (magit-abbrev-length))) - (if (derived-mode-p 'magit-log-mode) + (if (derived-mode-p 'magit-log-mode 'magit-reflog-mode) (when (eq magit-log-count (magit-log-get-commit-limit)) (magit-insert-section (longer) (insert-text-button @@ -1038,7 +1038,7 @@ Do not add this to a hook variable." (insert ?\n)))) (cl-defun magit-log-wash-rev (style abbrev) - (when (derived-mode-p 'magit-log-mode) + (when (derived-mode-p 'magit-log-mode 'magit-reflog-mode) (cl-incf magit-log-count)) (looking-at (pcase style (`log magit-log-heading-re) @@ -1206,7 +1206,7 @@ exists mostly for backward compatibility reasons." (defun magit-log-maybe-update-revision-buffer (&optional _) "When moving in a log or cherry buffer, update the revision buffer. If there is no revision buffer in the same frame, then do nothing." - (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode) + (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode) (magit-log-maybe-update-revision-buffer-1))) (defun magit-log-maybe-update-revision-buffer-1 () @@ -1232,7 +1232,7 @@ If there is no revision buffer in the same frame, then do nothing." (defun magit-log-maybe-update-blob-buffer (&optional _) "When moving in a log or cherry buffer, update the blob buffer. If there is no blob buffer in the same frame, then do nothing." - (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode) + (when (derived-mode-p 'magit-log-mode 'magit-cherry-mode 'magit-reflog-mode) (magit-log-maybe-update-blob-buffer-1))) (defun magit-log-maybe-update-blob-buffer-1 () diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index faabfec..13112b9 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -889,7 +889,9 @@ the mode of the current buffer derives from `magit-log-mode' or (display-buffer buffer (cond ((and (or git-commit-mode - (derived-mode-p 'magit-log-mode 'magit-cherry-mode)) + (derived-mode-p 'magit-log-mode + 'magit-cherry-mode + 'magit-reflog-mode)) (with-current-buffer buffer (derived-mode-p 'magit-diff-mode))) nil) diff --git a/lisp/magit-reflog.el b/lisp/magit-reflog.el index 60246bd..81c8cd4 100644 --- a/lisp/magit-reflog.el +++ b/lisp/magit-reflog.el @@ -137,7 +137,7 @@ AUTHOR-WIDTH has to be an integer. When the name of the author map) "Keymap for `magit-reflog-mode'.") -(define-derived-mode magit-reflog-mode magit-log-mode "Magit Reflog" +(define-derived-mode magit-reflog-mode magit-mode "Magit Reflog" "Mode for looking at Git reflog. This mode is documented in info node `(magit)Reflog'. |
