10 ms·
Ah, I didn't know that, thanks. Does it work branch "foo" is not in the same repository as "main" (eg. because you don't have write access to the repository)?
by progval 3y ago
Ah, I didn't know that, thanks. Does it work branch "foo" is not in the same repository as "main" (eg. because you don't have write access to the repository)?
- akoboldfrying 3y agoI haven't tried that specific case, but there's no reason for it not to work -- if #1 (you/foo) gets merged first, the only automatic modification that needs to happen is to change #2's target branch from you/foo to them/main, which is no problem since that target branch is just metadata that lives in your repo. (Merging #2 afterwards would again need to be done by someone with write access to them/main, as you'd expect.)
- progval 3y agoI mean, if both branches "foo" and "bar" are in your fork, you can't open a PR in the upstream repo, can you? As soon as I try, GitHub redirects me to my fork to create the PR there
- akoboldfrying 3y agobar is a descendant of foo, correct? That's the situation I'm talking about. Assuming that's the case, you want to make #2 a local PR anyway -- that is, its source is you/bar and its target is you/foo. Once #1 gets merged to them/main (by someone with the access to the upstream repo, "them"), #2 will (I predict, based on reasons I've already given) automatically become a PR "in" the repo them. That is, its target branch will automatically change to them/main.
- progval 3y agoI just tested, and it does not: after merging https://github.com/ZN3val/testrepo/pull/1 https://github.com/ZN3val/testrepo/pull/1, https://github.com/progval/testrepo/pull/2 https://github.com/progval/testrepo/pull/2 is not updated.
- akoboldfrying 3y agoThanks for checking, it seems I was wrong about when GitHub performs the auto-update. It happens not when the PR is merged, but rather when its underlying branch is deleted. From https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request https://docs.github.com/en/pull-requests/collaborating-with-...: >Note: If you delete a head branch after its pull request has been merged, GitHub checks for any open pull requests in the same repository that specify the deleted branch as their base branch. GitHub automatically updates any such pull requests, changing their base branch to the merged pull request's base branch. (This makes more sense, since if you keep the original branch around, it must be because you want to do more with it.) So try deleting the branch underlying your PR #1. I think #2's target should then auto-update.
- progval 3y agoIt auto-closed PR #2 and did not open a new one. Also, interestingly, there was no button on PR #1 to delete the branch from there as usual, I had to go to https://github.com/progval/testrepo/branches https://github.com/progval/testrepo/branches