Commit bcabbf21 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-branch-config-popup: bind in other popups

parent 19844e68
......@@ -6,6 +6,18 @@ Changes since v2.6.2
* Added new popup `magit-subtree-popup' and bound "O" to it.
* Added new popup `magit-branch-config-popup' and made it available
from the popups `magit-branch-popup', `magit-pull-and-fetch-popup',
`magit-pull-popup', `magit-fetch-popup', and `magit-push-popup'.
With a prefix argument it reads a the branch to be configured in
the minibuffer instead of using the current branch.
* Added new option `magit-branch-popup-show-variables', defaulting to
t to avoid changing key bindings. When set to nil, no variables are
displayed directly in the `magit-branch-popup', instead the subpopup
`magit-branch-config-popup' has to be used.
* Added new commands `magit-worktree-checkout',
`magit-worktree-branch', `magit-worktree-delete',
and `magit-worktree-status'.
......
......@@ -178,7 +178,9 @@ Delete the symbolic-ref \"refs/remotes/<remote>/HEAD\"."
'magit-commands
:man-page "git-fetch"
:switches '((?p "Prune deleted branches" "--prune"))
:actions '("Fetch from"
:actions '("Configure"
(?C "variables..." magit-branch-config-popup)
"Fetch from"
(?p magit-get-push-remote magit-fetch-from-pushremote)
(?u magit-get-remote magit-fetch-from-upstream)
(?e "elsewhere" magit-fetch)
......@@ -271,9 +273,11 @@ removed on the respective remote."
"Popup console for pull commands."
'magit-commands
:man-page "git-pull"
:variables '((?r "branch.%s.rebase"
:variables '("Configure"
(?r "branch.%s.rebase"
magit-cycle-branch*rebase
magit-pull-format-branch*rebase))
magit-pull-format-branch*rebase)
(?C "variables..." magit-branch-config-popup))
:actions '((lambda ()
(--if-let (magit-get-current-branch)
(concat
......@@ -315,10 +319,11 @@ missing. To add them use something like:
\\='magit-fetch-from-push-remote ?F))"
'magit-commands
:man-page "git-pull"
:variables '("Pull variables"
:variables '("Configure"
(?r "branch.%s.rebase"
magit-cycle-branch*rebase
magit-pull-format-branch*rebase))
magit-pull-format-branch*rebase)
(?C "variables..." magit-branch-config-popup))
:actions '((lambda ()
(--if-let (magit-get-current-branch)
(concat
......@@ -418,7 +423,9 @@ removed after restarting Emacs."
(?d "Dry run" "--dry-run")
,@(and (not magit-push-current-set-remote-if-missing)
'((?u "Set upstream" "--set-upstream"))))
:actions '((lambda ()
:actions '("Configure"
(?C "variables..." magit-branch-config-popup)
(lambda ()
(--when-let (magit-get-current-branch)
(concat (propertize "Push " 'face 'magit-popup-heading)
(propertize it 'face 'magit-branch-local)
......
......@@ -279,6 +279,16 @@ prefer the former, then you should add branches such as \"master\",
:group 'magit-commands
:type '(repeat string))
(defcustom magit-branch-popup-show-variables t
"Whether the `magit-branch-popup' shows Git variables.
This defaults to t to avoid changing key bindings. When set to
nil, no variables are displayed directly in this popup, instead
the sub-popup `magit-branch-config-popup' has to be used to view
and change branch related variables."
:package-version '(magit . "2.7.0")
:group 'magit-commands
:type 'boolean)
(defcustom magit-repository-directories nil
"Directories containing Git repositories.
Magit checks these directories for Git repositories and offers
......@@ -1297,44 +1307,26 @@ Non-interactively DIRECTORY is (re-)initialized unconditionally."
"Popup console for branch commands."
'magit-commands
:man-page "git-branch"
:variables '("Configure existing branches"
(?d "branch.%s.description"
magit-edit-branch*description
magit-format-branch*description)
(?u "branch.%s.merge"
magit-set-branch*merge/remote
magit-format-branch*merge/remote)
(?r "branch.%s.rebase"
magit-cycle-branch*rebase
magit-format-branch*rebase)
(?p "branch.%s.pushRemote"
magit-cycle-branch*pushRemote
magit-format-branch*pushRemote)
"Configure repository defaults"
(?\M-r "pull.rebase"
magit-cycle-pull.rebase
magit-format-pull.rebase)
(?\M-p "remote.pushDefault"
magit-cycle-remote.pushDefault
magit-format-remote.pushDefault)
"Configure branch creation"
(?U "branch.autoSetupMerge"
magit-cycle-branch*autoSetupMerge
magit-format-branch*autoSetupMerge)
(?R "branch.autoSetupRebase"
magit-cycle-branch*autoSetupRebase
magit-format-branch*autoSetupRebase))
:actions '((?b "Checkout" magit-checkout)
(?n "Create new branch" magit-branch)
(?m "Rename" magit-branch-rename)
(?C "Configure..." magit-branch-config-popup)
(?c "Checkout new branch" magit-branch-and-checkout)
(?s "Create new spin-off" magit-branch-spinoff)
(?x "Reset" magit-branch-reset)
(?m "Rename" magit-branch-rename)
(?w "Checkout new worktree" magit-worktree-checkout)
(?W "Create new worktree" magit-worktree-branch)
(?x "Reset" magit-branch-reset) nil nil
(?k "Delete" magit-branch-delete))
:default-action 'magit-checkout
:max-action-columns 3)
:max-action-columns 3
:setup-function 'magit-branch-popup-setup)
(defvar magit-branch-config-variables)
(defun magit-branch-popup-setup (val def)
(magit-popup-default-setup val def)
(magit-popup-put :variables (magit-popup-convert-variables
val magit-branch-config-variables)))
;;;###autoload
(defun magit-checkout (revision)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment