Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add support for backporting PRs “merged” using the rebase strategy #35

Open
webknjaz opened this issue Mar 8, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@webknjaz
Copy link
Member

webknjaz commented Mar 8, 2023

@ekohl recently brought up that Patchback gets confused when asked to cherry-pick PRs with several commits that are “merged” using the rebase strategy. My guess is that this is because the API reports one single “merge commit” that is the last commit in the sequence. So our git cherry-pick <committish> invocations would hit conflicts for a series of stacked commits that modify the same code regions.

This is not a problem for true merges and squash-“merges” since both have enough context for cherry-pick to succeed if there's no other conflicts. These operate on a single commit (the true merge needs a -m1 CLI arg, but is the same as squash otherwise).

For rebase-driven “merges”, we need to teach Patchback count the number of the commits in the PR (possible edge-case: merge commits in the PR branch).
Another thing to decide: are the backports expected to squash said series of commits into one, or attempt to preserve the individual ones? Should this be configurable per-repo?

Oh, and how about the fast-forward merges? These don't have a dedicated merge commit and are similar in that they may introduce several new commits in the target branch. I don't think such a merge can be performed from GitHub UI, but it can be done locally, and when pushed, it also marks the PRs as merged, so it'd trigger the same backporting events… We should probably try to detect this edge case too.

Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant