Guide to pushing to submitters' repo?

Hi,
We now have a functionality to allow core developers to push to PR repositories, but I can't find out how to make it work.
For example I have:
$ git remote -v gescheit git://github.com/gescheit/cpython.git (fetch) gescheit git://github.com/gescheit/cpython.git (push) origin https://github.com/python/cpython (fetch) origin https://github.com/python/cpython (push) pitrou git@github.com:pitrou/cpython.git (fetch) pitrou git@github.com:pitrou/cpython.git (push)
Then I try:
$ git push fatal: remote error: You can't push to git://github.com/gescheit/cpython.git Use https://github.com/gescheit/cpython.git
So I try with the HTTPS URL instead:
$ git remote set-url gescheit https://github.com/gescheit/cpython.git $ git push Username for 'https://github.com': ^C
Did someone manage to make this work? Can they post the entire instructions they used? (including local branch setup)
(Context: trying to edit https://github.com/python/cpython/pull/1785)
Thank you
Antoine.

On 25 May 2017 at 18:01, Antoine Pitrou <antoine@python.org> wrote:
Did someone manage to make this work? Can they post the entire instructions they used? (including local branch setup)
The minimal set of instructions some of us worked out are at https://docs.python.org/devguide/gitbootcamp.html#editing-a-pull-request-pri... (the initial draft was longer, but patch review found a few opportunities for simplification)
However, that can still fail if the submitter hasn't checked the "Allow edits by maintainers" option on their PR.
Cheers, Nick.
P.S. the "git pr" alias mentioned there is detailed a few entries earlier in the cheat sheet
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia

Le 25/05/2017 à 15:06, Nick Coghlan a écrit :
On 25 May 2017 at 18:01, Antoine Pitrou <antoine@python.org> wrote:
Did someone manage to make this work? Can they post the entire instructions they used? (including local branch setup)
The minimal set of instructions some of us worked out are at https://docs.python.org/devguide/gitbootcamp.html#editing-a-pull-request-pri... (the initial draft was longer, but patch review found a few opportunities for simplification)
Thank you. Is it possible for the "git pr" alias to also edit the branch tracking information? Currently I get:
(master)$ git pr 1785 Depuis https://github.com/python/cpython
- [nouvelle référence] refs/pull/1785/head -> pr_1785 Basculement sur la branche 'pr_1785'
(pr_1785)$ LANG=C git pull There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> pr_1785
Regards
Antoine.

The git pr alias in the devguide assumes that you have origin and upstream remote setup, where origin is your own CPython fork, and upstream is python/CPython repo
On May 25, 2017 6:27 AM, "Antoine Pitrou" <antoine@python.org> wrote:
Le 25/05/2017 à 15:06, Nick Coghlan a écrit :
On 25 May 2017 at 18:01, Antoine Pitrou <antoine@python.org> wrote:
Did someone manage to make this work? Can they post the entire instructions they used? (including local branch setup)
The minimal set of instructions some of us worked out are at https://docs.python.org/devguide/gitbootcamp.html# editing-a-pull-request-prior-to-merging (the initial draft was longer, but patch review found a few opportunities for simplification)
Thank you. Is it possible for the "git pr" alias to also edit the branch tracking information? Currently I get:
(master)$ git pr 1785 Depuis https://github.com/python/cpython
- [nouvelle référence] refs/pull/1785/head -> pr_1785 Basculement sur la branche 'pr_1785'
(pr_1785)$ LANG=C git pull There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> pr_1785
Regards
Antoine.
python-committers mailing list python-committers@python.org https://mail.python.org/mailman/listinfo/python-committers Code of Conduct: https://www.python.org/psf/codeofconduct/

On Thu, May 25, 2017 at 6:27 AM, Antoine Pitrou <antoine@python.org> wrote:
Le 25/05/2017 à 15:06, Nick Coghlan a écrit :
On 25 May 2017 at 18:01, Antoine Pitrou <antoine@python.org> wrote:
Did someone manage to make this work? Can they post the entire instructions they used? (including local branch setup)
The minimal set of instructions some of us worked out are at https://docs.python.org/devguide/gitbootcamp.html#editing-a-pull-request-pri... (the initial draft was longer, but patch review found a few opportunities for simplification)
Thank you. Is it possible for the "git pr" alias to also edit the branch tracking information? Currently I get:
(master)$ git pr 1785 Depuis https://github.com/python/cpython
- [nouvelle référence] refs/pull/1785/head -> pr_1785 Basculement sur la branche 'pr_1785'
(pr_1785)$ LANG=C git pull There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> pr_1785
Unfortunately, GitHub does not allow pushing back to refs/pull/*. To get it to set you up to push back to the contributor's repo, you'd need to provide the contributor's name and branch name, which is much less convenient if you're just looking to try out a patch locally without intending to push anything back. If I can figure out a good second alias for that, I'll be sure to share it.
You may be interested in the hub
tool, which has a command for
'check out this PR and set up a remote for it' (though I can't
remember what it is at the moment).
-- Zach

Le 25/05/2017 à 16:05, Zachary Ware a écrit :
Unfortunately, GitHub does not allow pushing back to refs/pull/*. To get it to set you up to push back to the contributor's repo, you'd need to provide the contributor's name and branch name, which is much less convenient if you're just looking to try out a patch locally without intending to push anything back. If I can figure out a good second alias for that, I'll be sure to share it.
If I knew how to do that, I certainly would :-)
You may be interested in the
hub
tool, which has a command for 'check out this PR and set up a remote for it' (though I can't remember what it is at the moment).
Thanks for the pointer. Unfortunately, it seems that it really wants to authenticate using username and password (even though browsing a public project):
$ hub checkout https://github.com/python/cpython/pull/1785 github.com username: pitrou github.com password for pitrou (never stored): ^C
Regards
Antoine.

On May 25, 2017, at 7:41 AM, Antoine Pitrou <antoine@python.org> wrote:
Le 25/05/2017 à 16:05, Zachary Ware a écrit :
Unfortunately, GitHub does not allow pushing back to refs/pull/*. To get it to set you up to push back to the contributor's repo, you'd need to provide the contributor's name and branch name, which is much less convenient if you're just looking to try out a patch locally without intending to push anything back. If I can figure out a good second alias for that, I'll be sure to share it.
If I knew how to do that, I certainly would :-)
You may be interested in the
hub
tool, which has a command for 'check out this PR and set up a remote for it' (though I can't remember what it is at the moment).Thanks for the pointer. Unfortunately, it seems that it really wants to authenticate using username and password (even though browsing a public project):
$ hub checkout https://github.com/python/cpython/pull/1785 github.com username: pitrou github.com password for pitrou (never stored): ^C
Antoine, do you have an SSH key stored within your GitHub account settings?
You would still use the same command for hub to checkout the pull request, but GitHub would stop nagging for username/password.
Regards
Antoine.
python-committers mailing list python-committers@python.org https://mail.python.org/mailman/listinfo/python-committers Code of Conduct: https://www.python.org/psf/codeofconduct/

Le 25/05/2017 à 17:52, Carol Willing a écrit :
Thanks for the pointer. Unfortunately, it seems that it really wants to authenticate using username and password (even though browsing a public project):
$ hub checkout https://github.com/python/cpython/pull/1785 github.com username: pitrou github.com password for pitrou (never stored): ^C
Antoine, do you have an SSH key stored within your GitHub account settings?
Yes, I do.
You would still use the same command for hub to checkout the pull request, but GitHub would stop nagging for username/password.
Apparently not...
Regards
Antoine.

On May 25, 2017, at 8:59 AM, Antoine Pitrou <antoine@python.org> wrote:
Le 25/05/2017 à 17:52, Carol Willing a écrit :
Thanks for the pointer. Unfortunately, it seems that it really wants to authenticate using username and password (even though browsing a public project):
$ hub checkout https://github.com/python/cpython/pull/1785 github.com username: pitrou github.com password for pitrou (never stored): ^C
Antoine, do you have an SSH key stored within your GitHub account settings?
Yes, I do.
You would still use the same command for hub to checkout the pull request, but GitHub would stop nagging for username/password.
Apparently not...
Looking at the hub man page https://hub.github.com/hub.1.html <https://hub.github.com/hub.1.html>, hub uses an OAuth token which is probably not set or not being found by the hub app.
See Configuration section and GitHub OAuth subsection in the man page. Hope that helps.
Regards
Antoine.
python-committers mailing list python-committers@python.org https://mail.python.org/mailman/listinfo/python-committers Code of Conduct: https://www.python.org/psf/codeofconduct/
participants (5)
-
Antoine Pitrou
-
Carol Willing
-
Mariatta Wijaya
-
Nick Coghlan
-
Zachary Ware