Skip to content
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

Diff in gutter appears after files are committed #483

Closed
jacobweber opened this issue Feb 20, 2019 · 40 comments · Fixed by #499
Closed

Diff in gutter appears after files are committed #483

jacobweber opened this issue Feb 20, 2019 · 40 comments · Fixed by #499
Labels

Comments

@jacobweber
Copy link

jacobweber commented Feb 20, 2019

  • VSCode Version: 1.31.1
  • OS Version: Mac OS 10.14.3
  • Extension Version: 1.47.1
  • System Language: en_us
  • SVN Version: 1.9.5

Issue

The diff in the gutter of an editor sometimes appears, even after all changes have been committed.

Steps to Reproduce

Doesn't always happen, but when it does:

  1. Commit some changes
  2. Open one the changed files. The gutter to the left of the editor still shows colors indicating diffs, and they can be clicked to show the committed changes.

Running svn stat shows nothing, so I'm sure the files have been committed.

SVN Output

When I open the file:

svn info --xml /path/to/file.php

Screenshots

sample

@JohnstonCode
Copy link
Owner

Suspect some encoding issue. I'm getting it occasionally.

@Yanpas
Copy link
Contributor

Yanpas commented Feb 26, 2019

Me too with unicode symbols. E.g. insert the following ¯\_(ツ)_/¯ to any utf8 file and you will notice gutter.

VS Code treats such file as CP1252 (see microsoft/vscode#33720), encoding detection should be fixed. So I guess it's vscode problem, particularly see my comment.

image

My bug is different

@JohnstonCode
Copy link
Owner

I'm getting it with ×

@jacobweber
Copy link
Author

jacobweber commented Feb 26, 2019

In my original example, there were no non-ASCII characters in the file. So I don't think it's an encoding issue (although I can also see that issue). In my case, the diffs show actual SVN diffs, but for changes that have already been committed. In fact, one file is showing diffs from multiple previous commits.

JohnstonCode added a commit that referenced this issue Mar 15, 2019
## [1.47.4](v1.47.3...v1.47.4) (2019-03-15)

### Bug Fixes

* If encoding is passed to svn.ts it uses that rather than guessing ([#499](#499)) ([17c5438](17c5438)), closes [#483](#483)
@JohnstonCode
Copy link
Owner

🎉 This issue has been resolved in version 1.47.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@jacobweber
Copy link
Author

This is still happening for me, using svn-scm 1.47.5. It wasn't the encoding issue in my case.

@edgardmessias
Copy link
Contributor

How this extension work for diff gutter:

  • Run in background the command: svn cat <file path>, and set content to ContentProvider, respecting files.encoding config.
  • The problem ocurr when files.autoGuessEncoding is true and the encoding of document if different of files.encoding, or, user change the encoding without change the configuration

@edgardmessias
Copy link
Contributor

We need this to better work: microsoft/vscode#824

@jacobweber
Copy link
Author

@edgardmessias But I’m not seeing the diffs on non-ASCII characters; I’m seeing them on lines that were changed and committed. Maybe the diff info is cached somewhere?

@edgardmessias
Copy link
Contributor

Maybe, your file contains "\r\n" and "\n", yum can check with "notepad++" with show symbols

@JohnstonCode
Copy link
Owner

Yes there is a cache for the diff. Maybe this should be cleared on commits.

@JohnstonCode JohnstonCode reopened this Mar 19, 2019
@JohnstonCode JohnstonCode changed the title Diff in gutter appears when no changed files Diff in gutter appears after files are committed Mar 19, 2019
@jacobweber
Copy link
Author

@edgardmessias I just checked one of the files that has the diffs, and it uses CR everywhere; there's no LF.

@edgardmessias
Copy link
Contributor

edgardmessias commented Mar 20, 2019 via email

@JohnstonCode
Copy link
Owner

@jacobweber If you make changes to the open file and commit does the gutter stiff show the changes made? Also if you go to a different window and back are they still there?

@jacobweber
Copy link
Author

It's sporadic, so I'll answer you the next time it happens.

But in the past, it would show diffs from multiple already-committed versions of the file. And they'd still be there after closing/opening the window.

@jacobweber
Copy link
Author

OK, I just saw it on a file, with the gutter showing changes from several already-committed revisions.

I verified that the file only uses UNIX line endings, and has no non-ASCII characters.

I still see the gutter after closing and re-opening the file, or going to a different window and back.

If I make changes to the file, they're added to the existing changes in the gutter.

But I don't see them anymore after closing and re-opening the project containing that file.

@brainz80
Copy link

Not sure, but I'd guess this issue is related to microsoft/vscode#824. Unfortunately there seems to be some reluctance to fix the issue

@edgardmessias
Copy link
Contributor

edgardmessias commented May 29, 2019

After some tests, the problem occurs after convert EOL of file from CR to LF
But, when open another file and back, working fine (On windows machine)

edgardmessias added a commit to edgardmessias/svn-scm that referenced this issue Jun 3, 2019
JohnstonCode added a commit that referenced this issue Jun 3, 2019
## [1.50.3](v1.50.2...v1.50.3) (2019-06-03)

### Bug Fixes

* Fixed diff gutter cache (close [#483](#483)) ([#596](#596)) ([620b701](620b701))
@JohnstonCode
Copy link
Owner

🎉 This issue has been resolved in version 1.50.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jacobweber
Copy link
Author

Bad news...I still see it. I installed 1.52.2 yesterday, and have restarted since then.

I just committed a change, and still see the diffs for it. Then I committed another change to the same file, and I see the diffs for both changes.

The file I'm seeing it on has all UNIX line breaks (LF), and I don't think that has changed recently.

@edgardmessias
Copy link
Contributor

@jacobweber, small test, try open another file and back. My opinion is a bug on VSCode.

@jacobweber
Copy link
Author

I can close this file and re-open it, and it still shows the diffs.

@edgardmessias
Copy link
Contributor

@jacobweber, the problem of cache are fixed on 1.50.3, and 1.52.2 it is released today

@jacobweber
Copy link
Author

Sorry, you're right. But I installed 1.50.3 as soon as it was released, and have restarted since then.

@edgardmessias
Copy link
Contributor

@jacobweber, this line is called on each file is opened:

public async provideTextDocumentContent(uri: Uri): Promise<string> {

See in you log, each time you open another file and back, a svn cat command is called.
Please, open another file and back, after, paste log here

@jacobweber
Copy link
Author

OK. I just restarted, so I'll get the logs when it happens again.

@jacobweber
Copy link
Author

jacobweber commented Jun 4, 2019

Saw it again, and closed the file. Any time I reopen it now, I just see an info command in the log:

[myProject]$ svn info --xml /path/to/myProject/src/myFile.js

But if I open a different file, I see an info and a cat:

[myProject]$ svn info --xml /path/to/myProject/src/myOtherFile.js
[myProject]$ svn cat src/myOtherFile.js

@jacobweber
Copy link
Author

FYI, after I open the file with the problem, and I make a change to it, I get this in the logs:

[myProject]$ svn stat --xml --no-ignore --ignore-externals
[node_modules]$ svn info --xml
[config.json]$ svn info --xml
[node_modules]$ svn info --xml
[node_modules]$ svn: warning: W155010: The node '/path/to/myProject/node_modules' was not found.
[node_modules]$ svn: E200009: Could not display info for all targets because some targets don't exist[node_modules]$ svn: warning: W155010: The node '/path/to/myProject/src/node_modules' was not found.
[node_modules]$ svn: E200009: Could not display info for all targets because some targets don't exist

config.json and node_modules are non-versioned files, which aren't open. So this may be normal.

@edgardmessias
Copy link
Contributor

The svn info --xml if called by "Tree View", and svn cat by diff gutter.

@edgardmessias
Copy link
Contributor

@jacobweber, try reproduce same problem with GIT

@jacobweber
Copy link
Author

I'll try if I get some time, but I don't work regularly with git.

FYI, I'm seeing this with other projects, and the behavior is the same -- when I open the file with problems, it shows a "svn info" but no "svn cat" command.

@jacobweber
Copy link
Author

Could we re-open this? I'm seeing it a lot still.

@JohnstonCode JohnstonCode reopened this Sep 20, 2019
@JohnstonCode
Copy link
Owner

Is the encoding you see for the file in vscode correct?
image

@jacobweber
Copy link
Author

@JohnstonCode I'm seeing it now on one file that I just committed. The encoding in the status bar says UTF-8 and LF. I verified that the file has no non-ASCII characters (using file -I), and has only LF for line endings (using dos2unix -i), so it seems correct.

I also see the same behavior as above, where when I open this one file, the SVN shows a "svn info" but no "svn cat" command.

@JohnstonCode
Copy link
Owner

How are you committing? The extension or cli?

@jacobweber
Copy link
Author

The extension.

@JohnstonCode
Copy link
Owner

@jacobweber can you send me some sample files that this is happening with?

@jacobweber
Copy link
Author

Will do, next time it happens. Although I have a feeling it’s about the timing or environment, rather than the file contents.

@jacobweber
Copy link
Author

Here's one (inside sample.zip).

Doing "svn diff" or "svn stat" on the file shows no changes. It has only Unix line feeds, and no non-ASCII characters.

@JohnstonCode
Copy link
Owner

Thanks

@JohnstonCode JohnstonCode closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants