Skip to content

Conversation

@ambv
Copy link
Contributor

@ambv ambv commented May 20, 2022

In case of a git repository mirror, all branches are kept in sync all the time.
Trying to push out a particular refspec errors out with:

Failed to push to origin ☹
fatal: --mirror can't be combined with refspecs

Moreover, when a cherry-pick is pushed and the branch gets auto-deleted by cherry-picker, this introduces a dangerous situation for --mirror users. Again, with --mirror all branches are kept in sync. If I delete a branch locally from my ambv/cpython repository and then I push this change to GitHub, the remote branch will get automatically deleted on GitHub as well. So, if cherry-picker deletes a branch for PR-1, and then I push another unrelated change before PR-1 gets merged, PR-1 will get automatically closed by GitHub because the branch got deleted.

This change adds support for mirrors. Tested with:

python/cpython#92981
python/cpython#94495
python/cpython#94496 (pushing this one didn't auto-close the previous one)

In case of a git repository mirror, all branches are kept in sync all the time.
Trying to push out a particular refspec errors out with:

  Failed to push to origin ☹
  fatal: --mirror can't be combined with refspecs

This change adds support for mirrors. Tested with:

python/cpython#92981
Co-authored-by: Ezio Melotti <[email protected]>
@ezio-melotti ezio-melotti requested a review from Mariatta May 23, 2022 17:14
@ambv
Copy link
Contributor Author

ambv commented Jul 1, 2022

Now handling multiple open backports with --mirror is also correct (see the original description of the PR for details).

@ambv
Copy link
Contributor Author

ambv commented Aug 10, 2022

I'm landing this as I'm using it week-by-week for a few months now with no issues.

@ambv ambv merged commit 0ecbf06 into main Aug 10, 2022
@ambv ambv deleted the support-repository-mirrors branch August 10, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants