-
Notifications
You must be signed in to change notification settings - Fork 940
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
support maintaining multiple versions/branches on main #9362
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some scenarios, it's needed to maintain some legacy code, for example, the new code is 2.x and the legacy is 1.x which still needs to be maintained.
If a patch is needed to 1.x code, the component needs to be checked out to 1.x and tagged with a specific version, for example:
bit tag --ver 1.0.1 --ignore-newest-version
.Currently, when this patch is done, although the history of this patch is correct thanks to a recent PR, but the head now points to this patch version. As a result, when importing the component, the user gets 1.0.1 and not 2.x.
This PR introduces a new flag
--detach-head
to keep the head intact in this case, so the head still points to 2.x, while the .bitmap is updated to 1.0.1. This new patch 1.0.1 becomes a detached head.It also supports lanes. It's possible to work on multiple components when they're checked out to 1.x, create a new lane, snap some changes, then merge the lane with
--detach-head
flag. This flag, instruct bit to find the common snap before the divergent point, and merge the lane to that point and not to the head.In order for the garbage collector to not delete this detached-head snap, and for the remote to not identify this component as a merge-conflict, we save a new prop
detachedHeads
intoModelComponent
object.For now, this flag
--detach-head
is under a feature-flag. It'll be enabled by default once bit cloud is deployed with a new version that supports it.