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

Schema-only merging #7732

Open
macneale4 opened this issue Apr 11, 2024 · 4 comments
Open

Schema-only merging #7732

macneale4 opened this issue Apr 11, 2024 · 4 comments
Labels
enhancement New feature or request merge Issues relating to merge version control

Comments

@macneale4
Copy link
Contributor

A common use case which comes up is that users of Dolt want to make schema changes on one branch, then update other branches with the same change. Traditionally we would do this as a merge in the commit DAG, but there is no way to separate out data changes if they exist.

Options to Consider:

  1. Today you can have a Schema only branch which never receives merges from branches with data. There is no enforcement mechanism to ensure you never have data on that branch. We could make that a supported pattern that we enforce on a per-branch basis.
  2. dolt merge --schema-only - This would do what user's probably expect/want. The creation of a new merge would not play well with future merges though. The DAG model doesn't really provide use a way to know that the merged branch was schema only, and a future merge into your working branch would delete all of your data. Danger.d
  3. dolt cherry-pick --schema-only - This would pick the specific schema changes in the given commit. If there are multiple changes in your development branch which have schema changes, you would need to pick each of them individually. The down stream merging story would be very compelling though, and plays well into the DAG model.
  4. dolt rebase --schema-only - Cherry-pick on steroids - you wouldn't lose multiple schema updates.

(3) is probably the easiest to implement, and will probably be easiest to understand as a user.

@Trojanku
Copy link

Hey @macneale4, thanks for considering that.

Regarding the first point, Is there a way to create a new, empty branch something similar to '--oprhan' flag in git?

@timsehn
Copy link
Sponsor Contributor

timsehn commented Apr 12, 2024

Regarding the first point, Is there a way to create a new, empty branch something similar to '--oprhan' flag in git?

This is probably a new feature request. Make a new issue?

@nicktobey
Copy link
Contributor

If the user goal is just to copy schema changes into a different branch, then cherry pick feels a lot easier and safer than a merge. I'm sure merge could be done safely too, but would require some care to get right. So my bet's on (3) too.

@timsehn timsehn added enhancement New feature or request merge Issues relating to merge version control labels Apr 12, 2024
@timsehn
Copy link
Sponsor Contributor

timsehn commented Apr 12, 2024

I added a note on --orphan here: #4468

Seems like a good thing to do if we allow merging unrelated histories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request merge Issues relating to merge version control
Projects
None yet
Development

No branches or pull requests

4 participants