Commit 67d96c61 authored by Jonas Bernoulli's avatar Jonas Bernoulli

magit-branch-pull-request: Always set branch.<name>.pushRemote

Closes #3461.
Re #3439.
parent fb98ee0a
......@@ -7,7 +7,7 @@
#+TEXINFO_DIR_CATEGORY: Emacs
#+TEXINFO_DIR_TITLE: Magit: (magit).
#+TEXINFO_DIR_DESC: Using Git from Emacs with Magit.
#+SUBTITLE: for version 2.12.1 (2.12.1-138-g3dd660fe+1)
#+SUBTITLE: for version 2.12.1 (2.12.1-139-gfb98ee0a+1)
#+BIND: ox-texinfo+-before-export-hook ox-texinfo+-update-version-strings
#+TEXINFO_DEFFN: t
......@@ -22,7 +22,7 @@ directly from within Emacs. While many fine Git clients exist, only
Magit and Git itself deserve to be called porcelains.
#+TEXINFO: @noindent
This manual is for Magit version 2.12.1 (2.12.1-138-g3dd660fe+1).
This manual is for Magit version 2.12.1 (2.12.1-139-gfb98ee0a+1).
#+BEGIN_QUOTE
Copyright (C) 2015-2018 Jonas Bernoulli <jonas@bernoul.li>
......@@ -4259,6 +4259,9 @@ features are available from separate popups.
- ~branch.<name>.pullRequest~ is set to the pull-request number.
- ~branch.<name>.pullRequestRemote~ is set to the remote on which the
pull-request branch is located.
- ~branch.<name>.pushRemote~ is set to the same remote as
~branch.<name>.pullRequestRemote~ if that is possible, otherwise
it is set to the upstream remote.
- ~branch.<name>.description~ is set to the pull-request title.
- ~branch.<name>.rebase~ is set to ~true~ because there should be no
merge commits among the commits in a pull-request.
......@@ -4284,16 +4287,13 @@ features are available from separate popups.
fork/new-feature".
- If the pull-request branch is located in the upstream repository,
then it is not necessary to configure the push-target.
then you probably have set ~remote.pushDefault~ to that repository.
However some users like to set that variable to their personal
fork, even if they have push access to the upstream, so
~branch.<name>.pushRemote~ is set anyway.
(If you have push access to the upstream repository, then it is
usually a good idea to configure that as the push-remote using
~remote.pushDefault~. However even if you are not using that
recommended setting, then it is still easy enough to set
~branch.<name>.pushRemote~ while pushing using ~P p~.)
- If the pull-request branch is located inside a fork, then you
usually are able to push to that branch, because Github by default
- If the pull-request branch is located inside a fork, then you are
usually able to push to that branch, because Github by default
allows the recipient of a pull-request to push to the remote
pull-request branch even if it is located in a fork. The
contributor has to explicitly disable this.
......
......@@ -30,7 +30,7 @@ General Public License for more details.
@finalout
@titlepage
@title Magit User Manual
@subtitle for version 2.12.1 (2.12.1-138-g3dd660fe+1)
@subtitle for version 2.12.1 (2.12.1-139-gfb98ee0a+1)
@author Jonas Bernoulli
@page
@vskip 0pt plus 1filll
......@@ -52,7 +52,7 @@ directly from within Emacs. While many fine Git clients exist, only
Magit and Git itself deserve to be called porcelains.
@noindent
This manual is for Magit version 2.12.1 (2.12.1-138-g3dd660fe+1).
This manual is for Magit version 2.12.1 (2.12.1-139-gfb98ee0a+1).
@quotation
Copyright (C) 2015-2018 Jonas Bernoulli <jonas@@bernoul.li>
......@@ -5755,6 +5755,11 @@ These variables are always set by this command:
@code{branch.<name>.pullRequestRemote} is set to the remote on which the
pull-request branch is located.
@item
@code{branch.<name>.pushRemote} is set to the same remote as
@code{branch.<name>.pullRequestRemote} if that is possible, otherwise
it is set to the upstream remote.
@item
@code{branch.<name>.description} is set to the pull-request title.
......@@ -5786,18 +5791,15 @@ fork/new-feature".
@itemize
@item
If the pull-request branch is located in the upstream repository,
then it is not necessary to configure the push-target.
(If you have push access to the upstream repository, then it is
usually a good idea to configure that as the push-remote using
@code{remote.pushDefault}. However even if you are not using that
recommended setting, then it is still easy enough to set
@code{branch.<name>.pushRemote} while pushing using @code{P p}.)
then you probably have set @code{remote.pushDefault} to that repository.
However some users like to set that variable to their personal
fork, even if they have push access to the upstream, so
@code{branch.<name>.pushRemote} is set anyway.
@item
If the pull-request branch is located inside a fork, then you
usually are able to push to that branch, because Github by default
If the pull-request branch is located inside a fork, then you are
usually able to push to that branch, because Github by default
allows the recipient of a pull-request to push to the remote
pull-request branch even if it is located in a fork. The
contributor has to explicitly disable this.
......
......@@ -411,10 +411,10 @@ Please see the manual for more information."
((string-prefix-p "git://" upstream-url)
.head.repo.git_url)
(t (error "%s has an unexpected format" upstream-url)))))
(magit-call-git "branch" branch (concat remote "/" pr-branch))
(if (or .locked (not (equal branch pr-branch)))
(magit-set upstream "branch" branch "pushRemote")
(magit-set remote "branch" branch "pushRemote")))
(magit-call-git "branch" branch (concat remote "/" pr-branch)))
(if (or .locked (not (equal branch pr-branch)))
(magit-set upstream "branch" branch "pushRemote")
(magit-set remote "branch" branch "pushRemote"))
(magit-set remote "branch" branch "pullRequestRemote")
(magit-set "true" "branch" branch "rebase")
(magit-call-git "branch" branch
......
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