[Python-Dev] Helping contributors with chores (do we have to?) (original) (raw)

Nathaniel Smith njs at pobox.com
Sun Jun 25 13:02:44 EDT 2017


On Jun 25, 2017 08:12, "Jakub Wilk" <jwilk at jwilk.net> wrote:

A GitHub PR is just a git branch (in somebody else's repository, but also

in the repository it's submitted to). So, like any git branch, you can fetch it, re-branch to your local branch, apply any changes to it, rebase, push anywhere.

Right, this is documented here: https://help.github.com/articles/checking-out-pull-requests-locally/

There're also various tools for dealing specifically with git branch layout

as used by Github, and every real man writes their own

I have this in my gitconfig:

[alias] hub-pr = ! "_g() { set -e -u; git fetch origin "pull/$1/head:gh-$1" && git checkout "gh-$1"; }; _g"

If I want to checkout PR#42, I do:

$ git hub-pr 42

I believe you and Paul are missing the specific problem that Antoine was talking about, which is: how can we easily make changes to someone else's PR, i.e. these changes should show up in the diff view if you go to the PR's web page. This requires not just getting a copy of the PR branch locally, but also pushing it back to the original submitter's branch on GitHub.

Allegedly this is possible in most cases (there's a permissions toggle the submitter can set, but it's set by default):

https://help.github.com/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork/

However, like Antoine, when I've tried to do this then all I've managed is to get obscure errors from GitHub. Did I have the wrong incantations? Was the permissions toggle set wrong? (I thought the web ui said it wasn't, but maybe I misunderstood.) It's a mystery. Has anyone figured out how to make this work reliably or ergonomically?

Also, as a general comment, not directed at Jakub: the posturing about how easy git is reminds me of the posturing about how much better language X is than others described here: http://blog.aurynn.com/contempt-culture-2. My dudes, in a previous life I helped invent distributed VCS, but I still get confused by fiddly git BS just like everyone else. I know you probably aren't meaning to go around telling people that they're not Real Programmers because they get confused like me, but you are and it's not kind; please stop.

-n -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20170625/1aad6084/attachment.html>



More information about the Python-Dev mailing list