svn-scm icon indicating copy to clipboard operation
svn-scm copied to clipboard

Diff in gutter appears after files are committed

Open jacobweber opened this issue 6 years ago • 40 comments
trafficstars

  • 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

jacobweber avatar Feb 20 '19 23:02 jacobweber

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

JohnstonCode avatar Feb 22 '19 15:02 JohnstonCode

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 https://github.com/Microsoft/vscode/issues/33720), encoding detection should be fixed. So I guess it's vscode problem, particularly see my comment.

image

My bug is different

Yanpas avatar Feb 26 '19 07:02 Yanpas

I'm getting it with ×

JohnstonCode avatar Feb 26 '19 08:02 JohnstonCode

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.

jacobweber avatar Feb 26 '19 18:02 jacobweber

:tada: This issue has been resolved in version 1.47.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

JohnstonCode avatar Mar 15 '19 15:03 JohnstonCode

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

jacobweber avatar Mar 18 '19 20:03 jacobweber

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 avatar Mar 18 '19 20:03 edgardmessias

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

edgardmessias avatar Mar 18 '19 20:03 edgardmessias

@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?

jacobweber avatar Mar 18 '19 21:03 jacobweber

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

edgardmessias avatar Mar 19 '19 14:03 edgardmessias

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

JohnstonCode avatar Mar 19 '19 14:03 JohnstonCode

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

jacobweber avatar Mar 19 '19 23:03 jacobweber

You can check the svn cat output?

Em ter, 19 de mar de 2019 8:51 PM, Jacob Weber [email protected] escreveu:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JohnstonCode/svn-scm/issues/483#issuecomment-474628970, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdcdUvNbdn0SFZkjfi5Phd_FwWF7Kjaks5vYXgOgaJpZM4bGVQy .

edgardmessias avatar Mar 20 '19 00:03 edgardmessias

@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?

JohnstonCode avatar Mar 27 '19 12:03 JohnstonCode

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 avatar Mar 27 '19 17:03 jacobweber

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.

jacobweber avatar Apr 18 '19 17:04 jacobweber

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

brainz80 avatar May 17 '19 07:05 brainz80

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 avatar May 29 '19 18:05 edgardmessias

:tada: This issue has been resolved in version 1.50.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

JohnstonCode avatar Jun 03 '19 15:06 JohnstonCode

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.

jacobweber avatar Jun 04 '19 18:06 jacobweber

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

edgardmessias avatar Jun 04 '19 18:06 edgardmessias

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

jacobweber avatar Jun 04 '19 18:06 jacobweber

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

edgardmessias avatar Jun 04 '19 18:06 edgardmessias

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

jacobweber avatar Jun 04 '19 18:06 jacobweber

@jacobweber, this line is called on each file is opened: https://github.com/JohnstonCode/svn-scm/blob/f16c9f45f4b0b3f900854e514398e7ecc8c60fa1/src/svnContentProvider.ts#L97

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

edgardmessias avatar Jun 04 '19 18:06 edgardmessias

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

jacobweber avatar Jun 04 '19 18:06 jacobweber

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 avatar Jun 04 '19 19:06 jacobweber

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.

jacobweber avatar Jun 04 '19 19:06 jacobweber

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

edgardmessias avatar Jun 04 '19 20:06 edgardmessias

@jacobweber, try reproduce same problem with GIT

edgardmessias avatar Jun 05 '19 11:06 edgardmessias