bulldozer icon indicating copy to clipboard operation
bulldozer copied to clipboard

Support for rebasing before merging PR

Open arunpkio opened this issue 5 years ago • 7 comments

Is it possible to add an option to rebase the current branch before merging it to develop/master?

arunpkio avatar Feb 26 '19 13:02 arunpkio

Hi @arunpkqt ,

I guess we need to highlight this better in the docs, but the answer is yes! In the spec we allow users to specify the merge method as either rebase, squash or merge.

You can also specify method by branch if you want to treat develop/master/release different from one another.

asvoboda avatar Feb 26 '19 13:02 asvoboda

It looks like this setting configures the merge method when merging the branch to the target branch, but what I'd like to configure is the merge method when updating the branch from the target branch. This avoids the confusing git history when using merges to update the branch from the target branch.

I think this would mean that update: can be set to method: rebase

Perhaps this is already possible and I don't understand the configuration?

Thanks!

BrianChristie avatar Mar 15 '19 12:03 BrianChristie

I think that is a reasonable feature request. You are correct in that this isn't currently supported behaviour. While we don't have time right now to make the change, we accept PRs and will review requests in a timely manner.

I think if you wanted to take a shot at this, you'd want to to add the merge_method param to the update configuration, and then using that merge method https://github.com/palantir/bulldozer/blob/develop/bulldozer/update.go#L102

asvoboda avatar Mar 15 '19 13:03 asvoboda

On review, I don't think this is possible with the current Bulldozer architecture. The branch update feature relies on the Perform a merge API to do updates without making any local clones, and I believe that API can only create regular merge commits.

I don't want to add the complexity of managing local clones to Bulldozer, so I think this is blocked either on a new feature in GitHub or a clever way to perform a rebase using only the API, maybe via the Git Data APIs.

bluekeyes avatar Mar 21 '19 21:03 bluekeyes

That makes sense. I doubt that GitHub is going to add a rebase branch API any time soon, but I'll email them a feature request anyway. Thanks for having a look.

BrianChristie avatar Mar 22 '19 14:03 BrianChristie

There is a similar request on Kodiak (https://github.com/chdsbd/kodiak/issues/150) -- it looks like there may be a way to do this with just the GitHub API (https://github.com/chdsbd/kodiak/issues/150#issuecomment-516845049).

austince avatar May 19 '20 18:05 austince

This feature would be great to have! Any updates?

bateau84 avatar Apr 14 '23 13:04 bateau84