diff --git a/magit.el b/magit.el index 0de0bfcf..1d61c7c3 100644 --- a/magit.el +++ b/magit.el @@ -565,6 +565,16 @@ return nil." ;;; Revisions and ranges +(defvar magit-current-range nil + "The range described by the current buffer. +This is only non-nil in diff and log buffers. + +This has three possible (non-nil) forms. If it's a string REF or +a singleton list (REF), then the range is from REF to the current +working directory state (or HEAD in a log buffer). If it's a +pair (START . END), then the range is START..END.") +(make-variable-buffer-local 'magit-current-range) + (defun magit-list-interesting-refs () (let ((refs ())) (dolist (line (magit-git-lines "show-ref")) @@ -3577,6 +3587,7 @@ With a non numeric prefix ARG, show all entries" (defun magit-refresh-log-buffer (range style args) (magit-configure-have-graph) (magit-configure-have-decorate) + (setq magit-current-range range) (magit-create-log-buffer-sections (apply #'magit-git-section nil (magit-rev-range-describe range "Commits") @@ -3688,6 +3699,7 @@ level commits." ;;; Diffing (defun magit-refresh-diff-buffer (range args) + (setq magit-current-range range) (magit-create-buffer-sections (magit-git-section 'diffbuf (magit-rev-range-describe range "Changes")