-
Notifications
You must be signed in to change notification settings - Fork 123
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
Merge: Create merge API for tooling #3202
Comments
Thank you for creating the issue! What is your proposed API? One KeySet with 4 parentKeys? |
I imagined three separate parameters, as you proposed |
Then I do not understand the sentence "not on three sets but on three paths". The proposed API simply uses four sets instead of three.
I agree, it is also more consistent to me, and also more flexible. Only the amounts of parameters is a bit scary.
Please write the whole proposed signature here, it is unclear where you want to use char *.
I do not understand this question. In #3131 I listed all the callers. |
I left out for example int elektraMergeResult(Key * our, Key * their, Key * base, Key * result, int mergeStrategy, int behavior) {
if (behavior == fail on non-empty) {
return if something is below result;
}
KeySet * ourSet = get all keys below our;
KeySet * theirSet = get all keys below their;
KeySet * baseSet = get all keys below base;
// Does not read or write anything from or to database, does not have behavior anymore
KeySet * result = elektraMerge(ourSet, theirSet, baseSet, mergeStrategy);
if (behaviour == delete everything in result path) {
delete everything below result;
}
Write all keys from result to the database
return 0;
} But we could also do // our, their, base and result are representations of paths in Elektra like "user/something/to/merge"
int elektraMergeResult(char * our, char * their, char * base, char * result, int mergeStrategy, int behavior)
I was not aware that this list is exhaustive. In this case Key * might be better. |
In the signature KeySet is missing. So it is only about Key vs. char? |
I thought the whole discussion was about not using KeySet? |
Then I do not understand how it should work for tools. The whole conflict handling in tools assumes that there is a long-living KDB handle, which was not able to do a kdbSet. Did you read the documentation about kdbSet? It seems like this also needs to be covered in the merging tutorial if it is not clear even to you. I added it in #280. Let us discuss this today. |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
We should write an API call that performs a three-way merge not on three sets but on three paths in Elektra. It should be able to have different behavior with data that is already in the paths.
As explained by @markus2330 in PR #3106.
The text was updated successfully, but these errors were encountered: