ome / scc

OME tools for managing the Git(Hub) workflow
https://pypi.org/project/scc/
GNU General Public License v2.0
0 stars 15 forks source link

Use GitHub Pull Request reference for merging #257

Closed sbesson closed 4 years ago

sbesson commented 4 years ago

Rather than fetching the forks, this fetches the remote associated with the pull request as described in https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally.

In the case of deleted forks, this should improve the robustness of the merge command. It might also result in slight performance improvements as only the relevant commits will be fetched as opposed to all the branches of the forks.

See also #219 which is a RFE using a similar strategy for the rebase command

knabar commented 4 years ago

After initial testing, it looks like this PR also solves an issue I ran into with private repositories, where the build system does not have access to the private forks.

My approach was to use the GitHub token and the https://user:token@github.com/... style for remote URLs, but this approach is much simpler and cleaner, as it does not require passing the token all the way from argument parsing down to the merge method.

sbesson commented 4 years ago

Thanks @knabar for testing this and glad to see it is helping in a different context than the one targeted originally. Proposing to get this merged and released as a quick 0.12.6 /cc @joshmoore

sbesson commented 4 years ago

Now released as https://pypi.org/project/scc/0.12.6/