Commit a02d26a1 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-push-{quickly,elsewhere}: move definitions

parent 0f5d4ca7
......@@ -3676,26 +3676,26 @@ Also see [[info:gitman#git-push]].
This prefix command shows the following suffix commands along with
the appropriate infix arguments in a popup buffer.
- Key: P Q, magit-push-quickly
Push the current branch to ~branch.<name>.pushRemote~. If that
variable is unset, then push to ~remote.pushDefault~. If that
variable is unset too, then raise an error.
- Key: P P, magit-push-current
Push the current branch to its upstream branch. If the upstream
isn't set, then read the remote branch.
- Key: P o, magit-push
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
- Key: P e, magit-push-elsewhere
Push a branch or commit to some remote branch. Read the local and
remote branch.
- Key: P Q, magit-push-quickly
- Key: P o, magit-push
Push the current branch to ~branch.<name>.pushRemote~. If that
variable is unset, then push to ~remote.pushDefault~. If that
variable is unset too, then raise an error.
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
- Key: P m, magit-push-matching
......
......@@ -5207,6 +5207,14 @@ the git-push(1) manpage
This prefix command shows the following suffix commands along with
the appropriate infix arguments in a popup buffer.
@kindex P Q
@cindex magit-push-quickly
@item @kbd{P Q} @tie{}@tie{}@tie{}@tie{}(@code{magit-push-quickly})
Push the current branch to @code{branch.<name>.pushRemote}. If that
variable is unset, then push to @code{remote.pushDefault}. If that
variable is unset too, then raise an error.
@kindex P P
@cindex magit-push-current
@item @kbd{P P} @tie{}@tie{}@tie{}@tie{}(@code{magit-push-current})
......@@ -5214,13 +5222,6 @@ the appropriate infix arguments in a popup buffer.
Push the current branch to its upstream branch. If the upstream
isn't set, then read the remote branch.
@kindex P o
@cindex magit-push
@item @kbd{P o} @tie{}@tie{}@tie{}@tie{}(@code{magit-push})
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
@kindex P e
@cindex magit-push-elsewhere
@item @kbd{P e} @tie{}@tie{}@tie{}@tie{}(@code{magit-push-elsewhere})
......@@ -5228,13 +5229,12 @@ then read the remote branch.
Push a branch or commit to some remote branch. Read the local and
remote branch.
@kindex P Q
@cindex magit-push-quickly
@item @kbd{P Q} @tie{}@tie{}@tie{}@tie{}(@code{magit-push-quickly})
@kindex P o
@cindex magit-push
@item @kbd{P o} @tie{}@tie{}@tie{}@tie{}(@code{magit-push})
Push the current branch to @code{branch.<name>.pushRemote}. If that
variable is unset, then push to @code{remote.pushDefault}. If that
variable is unset too, then raise an error.
Push a branch to its upstream branch. If the upstream isn't set,
then read the remote branch.
@kindex P m
@cindex magit-push-matching
......
......@@ -197,6 +197,22 @@ then read the remote."
:default-action 'magit-push-current
:max-action-columns 3)
;;;###autoload
(defun magit-push-quickly (&optional args)
"Push the current branch to `branch.<name>.pushRemote'.
If that variable is unset, then push to `remote.pushDefault'.
If that variable is unset too, then raise an error."
(interactive (list (magit-push-arguments)))
(--if-let (magit-get-current-branch)
(-if-let (remote (magit-get-push-remote it))
(if (member remote (magit-list-remotes))
(progn
(run-hooks 'magit-credential-hook)
(magit-run-git-async-no-revert "push" "-v" args remote it))
(user-error "Remote `%s' doesn't exist" remote))
(user-error "No push-remote is configured for %s" it))
(user-error "No branch is checked out")))
;;;###autoload
(defun magit-push-current (branch remote &optional remote-branch args)
"Push the current branch to its upstream branch.
......@@ -207,6 +223,13 @@ the remote branch."
(interactive (magit-push-read-args t t))
(magit-push branch remote remote-branch args))
;;;###autoload
(defun magit-push-elsewhere (branch remote remote-branch &optional args)
"Push a branch or commit to some remote branch.
Read the local and remote branch."
(interactive (magit-push-read-args nil nil t))
(magit-push branch remote remote-branch args))
;;;###autoload
(defun magit-push (branch remote &optional remote-branch args)
"Push a branch to its upstream branch.
......@@ -222,13 +245,6 @@ the remote branch."
(format "%s:refs/heads/%s" branch remote-branch)
branch)))
;;;###autoload
(defun magit-push-elsewhere (branch remote remote-branch &optional args)
"Push a branch or commit to some remote branch.
Read the local and remote branch."
(interactive (magit-push-read-args nil nil t))
(magit-push branch remote remote-branch args))
(defcustom magit-push-always-verify 'nag
"Whether certain commands require verification before pushing.
......@@ -307,22 +323,6 @@ doing that, then you should probably just use `Pe' instead of
nil remote local 'confirm)))
(list local (car remote) (cdr remote) (magit-push-arguments))))
;;;###autoload
(defun magit-push-quickly (&optional args)
"Push the current branch to `branch.<name>.pushRemote'.
If that variable is unset, then push to `remote.pushDefault'.
If that variable is unset too, then raise an error."
(interactive (list (magit-push-arguments)))
(--if-let (magit-get-current-branch)
(-if-let (remote (magit-get-push-remote it))
(if (member remote (magit-list-remotes))
(progn
(run-hooks 'magit-credential-hook)
(magit-run-git-async-no-revert "push" "-v" args remote it))
(user-error "Remote `%s' doesn't exist" remote))
(user-error "No push-remote is configured for %s" it))
(user-error "No branch is checked out")))
;;;###autoload
(defun magit-push-matching (remote &optional args)
"Push all matching branches to another repository.
......
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