From 81e2d01d03a99e448c2e43973b79c0209f54b052 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 24 Jun 2010 17:42:55 -0700 Subject: [PATCH 1/4] The purpose of this branch is to expose more information about the current submode. Currently, many submodes retain state only in magit-refresh-args. This prevents other code from easily accessing this state. From abe8a031ff4ae86570570aac1bdc8e5835520728 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 24 Jun 2010 18:02:49 -0700 Subject: [PATCH 2/4] Add a magit-current-range variable for diff and log buffers. --- magit.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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") From cb5ca4ce40c83e7301289fc9dd364dc913bf2de3 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 24 Jun 2010 18:05:50 -0700 Subject: [PATCH 3/4] Add a magit-reflog-head variable for reflog buffers. --- magit.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/magit.el b/magit.el index 1d61c7c3..373eb896 100644 --- a/magit.el +++ b/magit.el @@ -3665,7 +3665,13 @@ level commits." ;;; Reflog +(defvar magit-reflog-head nil + "The HEAD of the reflog in the current buffer. +This is only non-nil in reflog buffers.") +(make-variable-buffer-local 'magit-reflog-head) + (defun magit-refresh-reflog-buffer (head args) + (setq magit-reflog-head head) (magit-create-log-buffer-sections (magit-git-section 'reflog (format "Local history of head %s" head) From 5c5ba412b9e9d63088d7031001e3d1c577f3d433 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Thu, 24 Jun 2010 18:14:13 -0700 Subject: [PATCH 4/4] Add magit-wazzup-head and magit-wazzup-all-p variables for wazzup buffers. --- magit.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/magit.el b/magit.el index 373eb896..a3937f5a 100644 --- a/magit.el +++ b/magit.el @@ -3741,6 +3741,16 @@ This is only non-nil in reflog buffers.") ;;; Wazzup +(defvar magit-wazzup-head nil + "The integration head for the current wazzup buffer. +This is only non-nil in wazzup buffers.") +(make-variable-buffer-local 'magit-wazzup-head) + +(defvar magit-wazzup-all-p nil + "Non-nil if the current wazzup buffer displays excluded branches. +This is only meaningful in wazzup buffers.") +(make-variable-buffer-local 'magit-wazzup-all-p) + (defun magit-wazzup-toggle-ignore (branch edit) (let ((ignore-file ".git/info/wazzup-exclude")) (if edit @@ -3756,6 +3766,8 @@ This is only non-nil in reflog buffers.") (magit-need-refresh)))) (defun magit-refresh-wazzup-buffer (head all) + (setq magit-wazzup-head head) + (setq magit-wazzup-all-p all) (let ((branch-desc (or head "(detached) HEAD"))) (unless head (setq head "HEAD")) (magit-create-buffer-sections