-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add "squash merge" support to merge API #8464
Conversation
♻️ PR Preview 9980ba3 has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
This turned out to be a really small feature, about 3 lines of actual code. Useful e.g. for this, required for delta-rs support. |
@ion-elgreco I think this will help your use-case. |
Awesome! 🙏😎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to understand a bit further:
Examining Git's squash semantics, it looks a bit different from the suggested change. According to Git, the changes from the list of commits being squashed are combined to a single commit, thus rewriting the history. That means that I cannot traverse the changes throughout the commits because they all exist in a single commit.
Are those the semantics expressed in this feature? If so, how are they reflected in the suggested implementation?
You're right but so am I! Git This PR is more like GitHub squash-merge! You get a new commit on the destination branch, with all the changes on the search branch from the merge base. There is no way to traverse from the destination branch to those changes - the source branch parent is missing. @ion-elgreco is this what you want, or do you actually want the Git "bring-me-the-changes-but-only-stage-them" behaviour? |
Squashing really just means removing the source branch as a parent of the resulting commit. Fixes #7382.
fedacd4
to
4ba04c4
Compare
@arielshaqed actually both things are useful, however currently I was mainly looking for a GitHub squash-merge like you say! An additional commit API though that can do squash from head, so all new commits since it was branched off to squash into one commit can be practical for other usecases |
@arielshaqed Got it! Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Looks very good, although a sassy developer might be surprised to get the GitHub version of a squash merge rather than the Git version. You might add some clarification in the docs (description) on that, and you might not 😀
I've also noticed that lakeCTL isn't updated with the new capability and it might be a quick win here (of course that it's not a part of the PR, but releasing a version with the client already updated can be nice)...
efb1d18
to
4b8a626
Compare
cc776f8
to
e16993e
Compare
e16993e
to
9980ba3
Compare
Great, thanks!
Done! 9ca1331
Did that too, in 54dbde3. I even added a lakectl test as 9980ba3; it took a while but is somewhat cool. Pulling once tests pass. |
Squashing really just means removing the source branch as a parent of the
resulting commit.
Fixes #7382.