This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 92
Add "explicitMerge" ModOp #174
Open
Shad0wlife
wants to merge
1
commit into
xforce:develop
Choose a base branch
from
Shad0wlife:feature-explicit-merge
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
This is effectively a more reliable merge with order independent patching (except for items with the same name, they are still targeted in their order relative to each other). Unlike merge, this ModOp requires the content of the ModOp tag to explicitly mirror the full structure of the targeted node (hence the name). No nodes will be removed or added, only the given pcdata nodes will be replaced.
This is currently functionally identical to #187 , only that it's named explicitMerge. If this implementation is preferred over the non-recursive variant there, I can change the modop to be named "patch" as well. |
@Shad0wlife I didn't care to fork the repository, however this handles the silent fail by skipping the child and continuing on, and most of the code has been cleaned up and commented.
|
Implemented as |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 is effectively a more reliable merge with order independent patching (except for items with the same name, they are still targeted in their order relative to each other). The code for this modop is actually the same size or smaller compared to the "old" merge, at least when removing the comments.
Unlike "merge", "explicitMerge" requires the content of the ModOp tag to explicitly mirror the full structure of the targeted node (hence the name). No nodes will be removed or added, only the given pcdata nodes will be replaced.
This kind of "merge alternative" is especially useful, if we decide to close #173 due to the added complexity there.
A possible addition to this feature could be deprecating the "old" merge, or warning when it gets used for its reduced resilience to updates.