Open jaraco opened 1 year ago
I imagine one could configure upstream to also push to the upstream repo
Personally, as someone who's always used the fork workflow, I just keep my upstream
pointing to the actual upstream. However, I have it set up to use HTTPS while pushes to my fork use SSL, so just in case I do make a mistake, I'm prompted for my username and password before it does anything so its clear I've made a mistake.
but that also increases the risk someone would accidentally push a branch to upstream.
Actually, this isn't possible to accidentally do anymore (for non-admins/RMs) now that python/core-workflow#460 is implemented on cpython
(and devguide, peps, and this repo, etc.), so you should be safe there even without doing anything special on your end.
Today I was working on an issue in miss-islington. In particular, I was working on https://github.com/python/miss-islington/pull/590. Per the dev guidance, I have the repo configured with a fork:
I used the
gh
tool to check out the pull request:I made a revision and then wished to push that revision to the branch from which I'd pulled it. However, because I've configured
upstream
forjaraco/miss-islington (push)
, pushing the changes didn't go to the original branch but went to my fork instead:I guess that makes sense. A branch probably only tracks its "remote" and not the actual resource from which it was pulled.
As a result, I needed to manually push the changes to the actual upstream, which led to another problem:
Because I needed to manually type the URL, I mistakenly used
python/cpython
(out of habit) instead of the correct repo (python/miss-islington
), so I ended up pushing draft commits for miss-islington to cpython (oops). I hope the deletion effectively undid that change. I then pushed the changes to the intended target.That worked and triggered the CI run again.
What I wonder - is there a way to configure the fork workflow such that when one checks out a PR in the upstream repo that it's tracked properly?
I imagine one could configure
upstream
to also push to the upstream repo, but that also increases the risk someone would accidentally push a branch to upstream.