Commit bf89b124 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-push-to-remote: new command

But do not add it to the push popup by default.
parent 1721f4b6
......@@ -52,6 +52,9 @@ Changes since v2.3.0
instructions are followed, then the popup shows what will happen if
the command is used. #2453
* The command `magit-push-to-remote' was added. The command's
doc-string explains how to add it to the push popup. #2453
* The option `magit-push-always-verify' was removed. That was only a
temporary kludge to keep users from shooting themselves in the foot.
This is no longer necessary because one now always sees were one is
......
......@@ -3941,6 +3941,10 @@ Also see [[info:gitman#git-push]].
Push a tag to another repository.
Two more push commands exist, which by default are not available from
the push popup. See their doc-strings for instructions on how to add
them to the popup.
- Command: magit-push-implicitly args
Push somewhere without using an explicit refspec.
......@@ -3952,6 +3956,18 @@ Also see [[info:gitman#git-push]].
~branch.<branch>.remote~, ~branch.<branch>.merge~, and
~remote.<remote>.push~.
- Command: magit-push-to-remote remote args
Push to the remote REMOTE without using an explicit refspec. The
remote is read in the minibuffer.
This command simply runs ~git push -v [ARGS] REMOTE~. ARGS are the
arguments specified in the popup buffer. No refspec arguments are
used. Instead the behavior depends on at least these Git variables:
~push.default~, ~branch.pushDefault~, ~branch.<branch>.pushRemote~,
~branch.<branch>.remote~, ~branch.<branch>.merge~, and
~remote.<remote>.push~.
- User Option: magit-push-current-set-remote-if-missing
This option controls whether missing remotes are configured before
......
......@@ -5539,9 +5539,12 @@ remote configured for the current branch as default.
@item @kbd{P T} @tie{}@tie{}@tie{}@tie{}(@code{magit-push-tag})
Push a tag to another repository.
@end table
Two more push commands exist, which by default are not available from
the push popup. See their doc-strings for instructions on how to add
them to the popup.
@cindex magit-push-implicitly args
@deffn Command magit-push-implicitly args
......@@ -5555,6 +5558,20 @@ used. Instead the behavior depends on at least these Git variables:
@code{remote.<remote>.push}.
@end deffn
@cindex magit-push-to-remote remote args
@deffn Command magit-push-to-remote remote args
Push to the remote REMOTE without using an explicit refspec. The
remote is read in the minibuffer.
This command simply runs @code{git push -v [ARGS] REMOTE}. ARGS are the
arguments specified in the popup buffer. No refspec arguments are
used. Instead the behavior depends on at least these Git variables:
@code{push.default}, @code{branch.pushDefault}, @code{branch.<branch>.pushRemote},
@code{branch.<branch>.remote}, @code{branch.<branch>.merge}, and
@code{remote.<remote>.push}.
@end deffn
@defopt magit-push-current-set-remote-if-missing
This option controls whether missing remotes are configured before
......
......@@ -572,6 +572,32 @@ the popup buffer."
(propertize "push.default" 'face 'bold)
(propertize default 'face 'bold))))))
;;;###autoload
(defun magit-push-to-remote (remote args)
"Push to REMOTE without using an explicit refspec.
The REMOTE is read in the minibuffer.
This command simply runs \"git push -v [ARGS] REMOTE\". ARGS
are the arguments specified in the popup buffer. No refspec
arguments are used. Instead the behavior depends on at least
these Git variables: `push.default', `branch.pushDefault',
`branch.<branch>.pushRemote', `branch.<branch>.remote',
`branch.<branch>.merge', and `remote.<remote>.push'.
To add this command to the push popup add this to your init file:
(with-eval-after-load \\='magit-remote
(magit-define-popup-action \\='magit-push-popup ?r
'magit-push-to-remote--desc
'magit-push-to-remote ?p t))"
(interactive (list (magit-read-remote "Push to remote")
(magit-push-arguments)))
(run-hooks 'magit-credential-hook)
(magit-run-git-async-no-revert "push" "-v" args remote))
(defun magit-push-to-remote--desc ()
(format "using %s\n" (propertize "git push <remote>" 'face 'bold)))
;;; Email
;;;###autoload (autoload 'magit-patch-popup "magit-remote" nil t)
......
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