-
-
Notifications
You must be signed in to change notification settings - Fork 196
Incorrect CHANGE? #114
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
Comments
Isn't #113 a duplicate? |
yes, I closed that. |
So I am on it. I am implementing now a solution that delivers:
I assume I am following your first suggestion. |
wumpz
added a commit
that referenced
this issue
Jan 16, 2021
wumpz
added a commit
that referenced
this issue
Jan 16, 2021
Could you check it? I deployed a new snapshot. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Let's assume we had a file with such a content:
"
A
B
C
D
E
"
We changed the file to:
"
a
C
E
"
Patch =
ChangeDelta, position=0, lines = [A, B] to [a]
UnchangedDelta, position=2, lines = [C] to [C]
ChangeDelta, position=3, lines = [D] to []
UnchangedDelta, position=4, lines = [E] to [E]
DiffRows =
CHANGE, "A" -> "a"
CHANGE, "B" -> ""
CHANGE, "C" -> "C"
CHANGE, "D" -> ""
CHANGE, "E" -> "E"
So DiffRows mixed two absolutely different situations:
CHANGE, "B" -> "" - that was a part of change but has no correspondence in the new file (maybe only "no line")
CHANGE, "D" -> "" - that was actually changed to the empty line
And we cannot distinguish what line in the new file is for E now.
3, 4, or 5?
I offer to set not CHANGE but DELETE for the situation "B" -> "" (or insert vice versa).
Yes it was a part of the change section but in terms of lines it is a deletion. There was a line and there is no line now.
The expected result is:
CHANGE, "A" -> "a"
DELETE, "B" -> ""
CHANGE, "C" -> "C"
CHANGE, "D" -> ""
CHANGE, "E" -> "E"
Another possible solution is to use null for "B" -> "" that can help distinguish two options. But we need to work with null after that.
CHANGE, "A" -> "a"
CHANGE, "B" -> null
CHANGE, "C" -> "C"
CHANGE, "D" -> ""
CHANGE, "E" -> "E"
The error exists in the last version.
The text was updated successfully, but these errors were encountered: