-
-
Notifications
You must be signed in to change notification settings - Fork 195
Diffs containing target code equal to source code are not represented as in Git #202
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
bump |
bumping once again because this is behaving differently from how git displays changes and will drive me insane |
@wumpz Please fix |
Can confirm this issue as well. |
Also confirm |
It would be very useful to fix this. |
Is there anything wrong with the way diff utils calculate this? diff utils and git using different algorithms to calculate it. We using Myers and git uses some histogram algorithm. There is a subproject java-diff-utils-jgit which uses JGit to prerform all operations and provider java-diff-utils API. Look into the tests to see how to use it. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I recently encountered a bug where the way diffs are calculated differs from GitLab’s approach.
I've created an example to illustrate the issue. There are two lists to simulate lines before and after the changes.
There are two identical blocks of lines, so the changes can be interpreted in two different ways:
Git's approach: The first six lines are replaced with two new lines, while the last two lines remain unchanged.
DiffUtils' approach: The first two lines are replaced with two new lines, the next two lines remain unchanged, and the last four lines are removed.
While both approaches lead to the same final result, DiffUtils returns CHANGE, EQUAL, and DELETE blocks, whereas Git only uses CHANGE and EQUAL.
I'm attaching screens how this operation looks in github and how looks output from DiffUtils
Can you please fix the way the Diffs are calculated to match Git?
The text was updated successfully, but these errors were encountered: