microsoft / vscode

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

Git Diff Doesn't Show Changes in New Line Characters #19254

Open skl131313 opened 7 years ago

skl131313 commented 7 years ago

The diffeditor doesn't show new line ending changes (eg CRLF vs LF) even with "diffEditor.ignoreTrimWhitespace" set to false.

alexdima commented 7 years ago

It was never implemented, thus marking as feature request

SailorMax commented 6 years ago

If .git/config has "autocrlf = false" and try to commit file with other new line symbol, VSCode diff viewer show that file was changed but no changes in the file. In same time git diff show that changed all file. Why this is not a bug? How user can detect wrong new line symbol in the file?

DonPavlov commented 5 years ago

It would be nice to easily change the eol in the git diff view via selecting it in the button on the bottom.

mhanuszh commented 3 years ago

It looks like this feature is not a high priority, and that's understandable, but at least the diff viewer could show a warning, like Meld does: image

HarveyKBrown commented 3 years ago

See my issue mentioning this. The Stage Selected ranged option changes line endings which without diff showing line-ending changes makes it a hard issue to spot ahead of realising gitblame is saying you edited every single line in a file you barely edited.

HarveyKBrown commented 3 years ago

I also reccomend using "Render Line Ending" extension to better see when this issue happens, but it still wont make it register as a change in the diff.

ToBoMi commented 11 months ago

In https://github.com/Microsoft/vscode/issues/5118#issuecomment-423745232 it was suggested to merge that issue https://github.com/Microsoft/vscode/issues/5118 with this issue.

Let's continue tracking in https://github.com/microsoft/vscode/issues/19254 because that one has more upvotes.

Current title of that issue is: "Diff editor: Show encoding and eol differences"

This issue is not about showing encoding changes in the diff editor. The other issue is.

Please change this issue title that it includes encoding changes. If it stays like it is currently, the merge of the two issues lost one feature request (The "show also encoding changes" feature request).

I can understand if the original author of this issue does not want to change it. Then in future it would be good to ask for change before merging issue with different contents.

Original issue is locked - I cannot put this statement there. Creating a new issue would be an option. I'll do that if this issue is not changed.

queglay commented 10 months ago

We have repos with mixed line endings and not being able to see when I'm about to break a file with line endings changing isn't possible in vscode. I have to use git diff in command line. It would be very helpful to see a solution to this.

ToBoMi commented 10 months ago

@skl131313 can you change the title in a way that it includes encoding differences?

queglay commented 6 months ago

Just an update since some time has passed without a fix. others in my company that use pycharm dont have this problem - its pretty hard for me to sell others on vscode when I keep accidentally committing changes that overwrite the entire git blame for a file - because the viewer suppresses the actual delta for all the changes in line endings. I'd really like to see a fix for this point of embarrassment.