-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: implement PublicDirectory
conflict reconciliation
#426
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #426 +/- ##
==========================================
+ Coverage 54.35% 54.48% +0.12%
==========================================
Files 57 57
Lines 4003 4126 +123
Branches 980 1028 +48
==========================================
+ Hits 2176 2248 +72
- Misses 1191 1220 +29
- Partials 636 658 +22
|
Specifically: - trivially merge exactly equal nodes without creating a history entry - correctly reset `persisted_as` when creating a merge node - always advance the history entry when creating a merge node
matheus23
changed the title
feat: Conflict reconciliation
feat: implement Apr 18, 2024
PublicDirectory
conflict reconciliation
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.
This implements three functions:
PublicDirectory::reconcile
which takes two directories & reconciles all changes between them. Think of this as similar toget pull
, but where conflicts in files are merged automatically via a simple tie-breaking mechanism on the file hash. The return value indicates whether and which files were affected by the automatic merge, if at all.PublicDirectory::merge
, the underlying function forreconcile
, but which doesn't take into account if one of the directories may have been "ahead" in history. Use only if you know what you're doing, otherwise opt forreconcile
.PublicNode::causal_compare
, the underlying function inreconcile
that figures out whether one version of a node is "ahead" of another or behind, or if they're two conflicting versions and need to be merged.