microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.71k stars 29.08k forks source link

Diff editor shows that (almost) entire file has changed when it's not #69761

Closed alekseyt closed 5 years ago

alekseyt commented 5 years ago

Issue Type: Bug

Doesn't always reproduce, but i've found a file where it bugs out.

Steps to reproduce:

  1. Create a new Git repo: git init
  2. Commit file from https://unicode.org/Public/UCA/11.0.0/allkeys.txt
  3. Replace the same file with version 12.0.0: https://unicode.org/Public/UCA/12.0.0/allkeys.txt
  4. Open directory with this Git repo in vscode ("File: Open Folder")
  5. In sidebar select "Source control" and open diff editor

Result:

image

  1. Execute git diff in terminal (or Git Bash)

image

IMO output of git diff is more informative about what changes were made to this file between versions.

I've seen diff results like that before on other files (actual source code).

I've also prepared Git repository where issue reproduces so steps 1-3 can be skipped: repro.zip

VS Code version: Code 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e, 2018-11-15T19:07:43.495Z) OS version: Linux x64 4.4.0-142-generic

Extensions (5) Extension|Author (truncated)|Version ---|---|--- cpptools|ms-|0.19.0 shader|sle|1.1.4 vscode-lua|tri|0.12.4 cmake|twx|0.0.17 vscode-todo-highlight|way|1.0.4 (1 theme extensions excluded)
vscodebot[bot] commented 5 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

alexdima commented 5 years ago

I have added diffEditor.maxComputationTime and there is now a click widget that appears when the diff algorithm quits early.

To verify, download the .zip and open the diff. If the maximum computation time is reached, a widget is shown which helps with increasing the timeout.

alexdima commented 4 years ago

After discussions in standup, there is no click widget, but a notification when the diff computation times out.