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

Make bitmap less prone to merge conflicts #1671

Closed
itaymendel opened this issue May 27, 2019 · 1 comment
Closed

Make bitmap less prone to merge conflicts #1671

itaymendel opened this issue May 27, 2019 · 1 comment

Comments

@itaymendel
Copy link
Contributor

itaymendel commented May 27, 2019

Bit uses the .bitmap file to sync workspaces between developers. The file can be modified in any workspace. This can cause merge conflicts in git.

If such conflict is not resolved properly it can cause critical issues and forces manual modifications to the bitmap file. As bitmap is autogenerated and should only manage by Bit, we should reduce the possibility of merge conflicts.

At the moment, The content of the file is not sorted, which makes it even more likely to create conflicts. I suggest that Bit should keep the .bitmap sorted alphabetically, in ascending order:

  1. Sort components by their ID.
  2. Sort tracked files (per component) by relativePath.

When the bitmap file is not sorted, each workspace can potentially have its own unique order of components/files. In Bit it's irrelevant, but Git handles the contents of the files, so the order of the lines is important. I think that if we keep bitmap sorted it'll be less likely to cause merge conflicts that Git is unable to resolve automatically.

So when Bit writes content to bitmap, it should just make sure that it writes it after the sort. This way it's backward compatible. Additionally, it will only happen for actions that the user expects that'll cause modifications to the bitmap file.

@davidfirst
Copy link
Member

Part 1 (Sort components by their ID) has been implemented in the commit above.
Part 2 (Sort tracked files) was implemented a while ago.
I added e2e-tests for both parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants