← 输入框|github.com|刷新
Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Diff is calculating very wrong results #142

Open

Description

@ogil7190

While using the library, I have noticed that there is a serious problem with text diff, a very simple example is not working fine, looking at the code developed by google, it was hard for me to believe that, why it is not working fine. If you look at the screenshot below you will see that it is almost correct, but very wrong in results.

It is saying i have added certain lines, which were already a part of the original and input string.
Second, it has seriously messed up the order, in which they occur.

CAN ANYONE HELP HERE?

image

Activity

  1. dmsnell commented on Apr 28, 2023

    @dmsnell

    Hi @ogil7190 - I'm seeing what looks like accurate output, so maybe you could share what you see as being wrong in the output specifically.

    It's not showing that you've added lines at all, for example, only that the last eight words and additional u letter are not present in the input after removing the rest of the first paragraph.

    The diffs are a recipe to move from the first version to the second, and there's no guarantee that what it produces is going to be the same "edit script" you expect it to be. For some reason it recognized the long paragraph removal as a single deletion and added back in the part where the y changed into a u. It could have also deleted the y, inserted a u, kept the rest of the sentence, then deleted everything else.

    The important point to note though is that the patch should generate the second text when applied to the first, which in this case it looks like it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions