Skip to content

Commit

Permalink
magit-branch: Add global variable suffixes by default
Browse files Browse the repository at this point in the history
It was strange that one could already set `branch.<branch>.pushRemote'
directly from this menu, but to set `remote.pushDefault', one had to
use the "configure a particular branch" menu.  One even had to choose
which branch to configure, in order to configure this repository-wide
setting.

In `magit-branch' we cannot use "b" for `magit-update-default-branch',
because that conflicts with the binding for `magit-checkout'.  So use
"B" instead, both here and in `magit-branch-configure' for consistency.
  • Loading branch information
tarsius committed Feb 28, 2024
1 parent 7f68282 commit 0032ffc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lisp/magit-branch.el
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,24 @@ has to be used to view and change branch related variables."
(transient-define-prefix magit-branch (branch)
"Add, configure or remove a branch."
:man-page "git-branch"
["Variables"
:if (lambda ()
[:if (lambda ()
(and magit-branch-direct-configure
(oref (transient-prefix-object) scope)))
:description
(lambda ()
(concat (propertize "Configure " 'face 'transient-heading)
(propertize (oref (transient-prefix-object) scope)
'face 'magit-branch-local)))
("d" magit-branch.<branch>.description)
("u" magit-branch.<branch>.merge/remote)
("r" magit-branch.<branch>.rebase)
("p" magit-branch.<branch>.pushRemote)]
[:if-non-nil magit-branch-direct-configure
:description "Configure repository defaults"
("R" magit-pull.rebase)
("P" magit-remote.pushDefault)
("B" "Update default branch" magit-update-default-branch
:inapt-if-not magit-get-some-remote)]
["Arguments"
(7 "-r" "Recurse submodules when checking out an existing branch"
"--recurse-submodules"
Expand Down Expand Up @@ -864,7 +874,7 @@ and also rename the respective reflog file."
["Configure repository defaults"
("R" magit-pull.rebase)
("P" magit-remote.pushDefault)
("b" "Update default branch" magit-update-default-branch
("B" "Update default branch" magit-update-default-branch
:inapt-if-not magit-get-some-remote)]
["Configure branch creation"
("a m" magit-branch.autoSetupMerge)
Expand Down

0 comments on commit 0032ffc

Please sign in to comment.