VS Code does not respect the diff flag in .gitattributes
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.69.0
- OS Version: Windows 10.0.1.19044
Steps to Reproduce:
-
Open a local git repository in vscode
-
Make changes to a file
1.txt
, and then add this simple.gitattributes
file:*.txt -diff
-
Confirm output of
git diff
on the terminal:Binary files a/1.txt and b/1.txt differ
-
View the diff from VS Code Source Control panel.
Expected output:
VS Code source control panel shows “No preview available, binary files a/1.txt and b/1.txt differ” or a similar message.
Actual output:
VS Code shows the plaintext diff.
Context: I intend to unset the diff flag for certain large auto-generated files in my project. If I accidentally open their diff on the VS Code Source Control, currently, there is a noticeable lag (less than a second) and the rendered diff itself is unusable anyway. So, I’d prefer if VS Code just didn’t attempt to display the diff in the first place.
Cross-ref: SO post that I made two weeks ago about the same issue.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
Nice catch. I had written 1.6.90 instead of 1.69.0, fixed now.
@GaurangTandon, sorry this issue got lost in my notifications. I will try to take a quick look later this week.