-
Notifications
You must be signed in to change notification settings - Fork 321
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
Diff and resolve files on merge conflict #1013
Diff and resolve files on merge conflict #1013
Conversation
d9ae4fc
to
aca3d81
Compare
5260b7e
to
7078a87
Compare
- [WIP] See TODOs
- [WIP] console logs content - TODO: display diff
+ got eslint to shut up
- Remove MergeDiffModel - Delete PlainTextMergeDiff - Add unit test for base content
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
- TODO: update file with resolved conflicts
88f7176
to
1f26e0d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fcollonval, recent commit has the ability to view the merge conflict in theory.
I'm running into an issue which I can't seem to figure out. I've made a merge conflict on my local, and when I press the diff button, i get this error.
I'm not sure about what it means, but what I did notice is in the response body, the one merge decision that's in the array merge_decisions
, which is supposed to be one, since there is only one conflict in one cell, has the property remote_diff
as null
. Is this intended to be null
?
Am I missing anything else for the view to show up?
All the properties in the IMergeDecision
interface is all optional sooooo no way to tell anything 😝
Response from Server
{
"base": {
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"id": "054d802b-e56b-4594-9a8a-58564bb38d2c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "modified by HEAD\n"
}
],
"source": "print('modified by HEAD')"
},
{
"cell_type": "code",
"execution_count": 2,
"id": "b72f12bc-22b2-4e60-8321-07c2fd218414",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "modified by ORIG_HEAD\n"
}
],
"source": "print('modified by ORIG_HEAD')"
},
{
"cell_type": "code",
"execution_count": 6,
"id": "287ff473-5b96-4a27-98f2-55c080217a34",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "modified by HEAD\n"
}
],
"source": "print('modified by HEAD')"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
},
"merge_decisions": [
{
"common_path": [
"cells"
],
"conflict": false,
"action": "local",
"local_diff": [
{
"op": "addrange",
"key": 0,
"valuelist": [
{
"cell_type": "code",
"execution_count": 2,
"id": "054d802b-e56b-4594-9a8a-58564bb38d2c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": "modified by MERGE_HEAD\n"
}
],
"source": "print('modified by MERGE_HEAD')"
}
]
},
{
"op": "patch",
"key": 0,
"diff": [
{
"op": "replace",
"key": "execution_count",
"value": 1
},
{
"op": "patch",
"key": "id",
"diff": [
{
"op": "addrange",
"key": 0,
"valuelist": [
"b72f12bc-22b2-4e60-8321-07c2fd218414"
]
},
{
"op": "removerange",
"key": 0,
"length": 1
}
]
},
{
"op": "patch",
"key": "outputs",
"diff": [
{
"op": "patch",
"key": 0,
"diff": [
{
"op": "patch",
"key": "text",
"diff": [
{
"op": "patch",
"key": 0,
"diff": [
{
"op": "addrange",
"key": 12,
"valuelist": "MERGE_"
}
]
}
]
}
]
}
]
},
{
"op": "patch",
"key": "source",
"diff": [
{
"op": "patch",
"key": 0,
"diff": [
{
"op": "addrange",
"key": 19,
"valuelist": "MERGE_"
}
]
}
]
}
]
},
{
"op": "patch",
"key": 1,
"diff": [
{
"op": "replace",
"key": "execution_count",
"value": 3
},
{
"op": "patch",
"key": "id",
"diff": [
{
"op": "addrange",
"key": 0,
"valuelist": [
"287ff473-5b96-4a27-98f2-55c080217a34"
]
},
{
"op": "removerange",
"key": 0,
"length": 1
}
]
}
]
},
{
"op": "removerange",
"key": 2,
"length": 1
}
],
"remote_diff": null
}
]
}
This is definitely related to the new cell id. I thought ttps://github.com/jupyter/nbdime/pull/566 would have avoid the error. But obviously this is not the case... Pinging @krassowski and @vidartf on this one.
for cell in nb.cells:
del cell['id'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes.
I would like to rename isConflict to hasConflict that sounds better; hence the high number of suggestion 😉
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
Since those checkboxes are part of the nbdime view, I think we would need
Is there a function I can call in the widget/model to do part 2) ? |
Code in nbdime is there: https://github.com/jupyter/nbdime/blob/a74b538386d05e3e9c26753ad21faf9ff4d269d7/packages/nbdime/src/merge/widget/notebook.ts#L200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @navn-r this looks great. I added mainly doc comments and a request to remove the templating on the diff model. Then we can merge this one to work on integration tests.
Rename widget accessor + Update doc Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
5466b5f
to
8f2b16d
Compare
@all-contributors please add @navn-r for code |
I've put up a pull request to add @navn-r! 🎉 |
Fixes #896