treeverse / lakeFS

lakeFS - Data version control for your data lake | Git for data
https://docs.lakefs.io
Apache License 2.0
4.27k stars 341 forks source link

Feature Request: Add rebase option for branches #2739

Open mishraprafful opened 2 years ago

mishraprafful commented 2 years ago

Merging branches and resolving merge conflicts can be very difficult, It would be awesome if we have a rebase option also available.

Maybe we can choose a default option at the repository level? This somehow ties to integration with git, but I believe is a good feature on its own.

lynnro314 commented 2 years ago

Hi @mishraprafful, first of all thanks! I have some follow-up questions in order to see I fully understand your suggestion.

  1. What do you mean by "release option"? rebase option maybe? :)
  2. Do you think adding “ours” or “theirs” strategy options to lakeFS merge functionality will help solve the difficulties you encountered? Something like lakectl merge --strategy=theirs
arielshaqed commented 2 years ago

My 2 agoroth: Some people hate rebases, some love them. Git offers both, and the Git* tools also offer them (e.g. GitHub offers rebase-and-merge as a way to pull PRs). People hate rebases because they rewrite commit histories. People (myself included...) love rebases because they rewrite commit histories and allow you to fix things after the fact. I think we should be unopinionated here and offer rebases. Clearly workarounds exist, and equally clearly they are not as good for the people who want the actual feature. Also, some of the issues with rebases vanish with lakeFS, because it is not a distributed view.

mishraprafful commented 2 years ago

Hi @lynnro314

  1. yes, I think that was a typo from my end, I meant rebase option.
  2. I think that would help us for sure. 👍🏻

Also, thanks for your inputs @arielshaqed I think I completed agree with you.

lynnro314 commented 2 years ago

@mishraprafful

With rebase we diff each commit with the base branch and effectively rebasing each commit separately, so we'll need to resolve conflicts (if there are any) with every commit. With that in mind, I would love to hear about your requirements for the rebase feature. Do you thinks adding strategy options to lakeFS merge functionality will be enough (at this point) to solve the difficulties of resolving conflicts? Or the rebase feature is important regardless of resolving conflicts?

mishraprafful commented 2 years ago

@lynnro314 I think adding strategy options with merge works for us. I understand that having rebase adds more complexities in terms of resolving conflicts.

With the rebase, we would preserve all the commits that are added to the branch, and we wish to be able to revert to specific commits on the branches as well without having to keep the branches alive. So with rebase, we would be able to have all the effective versions of data on the main branch itself (i.e without losing individual commits on a branch, which we would if using merge to main)

However, once the rebase feature is rolled out we would use that instead of merge. But for now, having strategy options with merge works 🎉

lynnro314 commented 2 years ago

@mishraprafful Thanks for your answers! With respect to this I opened a new issue regarding the merge strategies.

2750

github-actions[bot] commented 9 months ago

This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.