python / cherry-picker

🐍🍒⛏ Utility script for backporting/cherry-picking CPython changes from master into one of the maintenance branches.
Apache License 2.0
46 stars 38 forks source link

Fix exit with bad state when backport branch already exists #39

Closed Jackenmen closed 1 year ago

Jackenmen commented 2 years ago

Fixes #38 I also went ahead and added a branch_name attribute to BranchCheckoutException which should allow miss-islington (or others using the API) to remove the problematic branch automatically (see https://github.com/python/miss-islington/pull/480). I don't think it would be wise for cherry-picker to do it for you since that potentially risks you losing some work.

ambv commented 2 years ago

Your change is still worth integrating but note that when a backport branch already exists, now cherry-picker will force-push to it (with --force-with-lease so only if there are no other changes on that remote branch):

https://github.com/python/cherry-picker/commit/7122a15bec80326f3fbfa44a2dafa059749c9963

Jackenmen commented 2 years ago

Does that mean I should change this to overwrite the existing local branch or should I leave it as it is right now? I went for the more cautious way but I don't really mind changing it if you think it would be better the other way.

Jackenmen commented 2 years ago

I resolved the conflict caused by #56. Since I'm already commenting, I just want to gently remind you that I haven't received a response to my question here. I realize it's probably a terrible time for a reminder since it's Christmas, it just so happened that I found about these conflicts while working on something else today 😄

Happy holidays!

Mariatta commented 1 year ago

Thanks for the work.