-
Notifications
You must be signed in to change notification settings - Fork 48
Can not discard changes on Source Control #1531
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
Comments
Hi @spieriArtera, this is a consequence of the client-side editing overhaul that was introduced for 3.0.0. Here's an except from the CHANGELOG:
What's happening in your case is that VS Code is syncing the file change event caused by the git discard, and the round-trip with the server is causing a diff because the class is not in the "canonical" format. The text of a class is not actually stored in the database. It's serialized into a global, and then deserialized again whenever the text is requested. This round-tripping will normalize the class definition text. For example, comments that aren't descriptions (triple slash before a class member) have newlines added between them and keyword names are changed to the canonical case (abstract -> Abstract). This is unavoidable, and is not unique to VS Code. This would happen if you edited the classes using Studio, or imported and re-exported them using the %SYSTEM.OBJ class. Assuming my assumptions are correct, I think you should round-trip all of your classes through IRIS and collect all of these formatting-related diffs into a single commit. This will prevent confusion related to this in the future. |
Hi @isc-bsaviano , if you assumption is correct, wouldn't I see the formatting changes on VS Code? The code looks identical on the Working Tree. |
Do you mind taking a screenshot of the diff? You can send me a DM on the Developer Community if you don't want to share your code publicly. It's possible that the diff is only trailing whitespace. Even if it's not just whitespace, it shouldn't be any functional changes. |
Unfortunately I can not share our code here or on developer community. Should I open a WRC instead? I can share it through that channel |
I meant you can send me a direct message via the Developer Community but opening a WRC case works as well. What I need to see the diff in the working tree. Then I can explain what changed. |
Hi @spieriArtera, I reviewed the images you shared with the WRC. I am also not seeing what the diff is. Is there just different whitespace in the ROUTINE line? Do you have a different git client tool ou can open like GitHub Desktop that might show the diff more clearly? For the class I don't see anything at all. Could it be line-ending issues? Our extensions always export using LF, even on Windows. That is not new behavior though. |
@isc-bsaviano I installed GitHub Desktop and I found the following about the 179 files marked as changed:
|
Thanks for the update. I am not sure what the 14 "no content changes found" changes are. I didn't think GitHub tracked changes that didn't affect content. The other 165 are confusing. This extension always exports to the file system using LF endings. Do you have any settings at the git level that could be changing these? https://docs.github.com/en/get-started/git-basics/configuring-git-to-handle-line-endings |
Hi @isc-bsaviano , we have found the same issue. I will explain some of our process maybe it can be of help finding a solution. We create a branch from our main branch, using VSCode and check out to it What i have noticed and i think this is what you said in your initial response, when switching back to the main branch the changed files "revert" to the state before the change, this then triggers a compile to IRIS (which i am certain was not the case in the past, or is just did not notice), after this compile on IRIS the files appear as changed. in the tracking list. |
Yes, this is new with version 3. However, the "round-tripping" with the server that I think is producing the changes has always existed. The only difference is that all file changes are now synced automatically, rather than needing to be manually imported. Are your "ghost changes" line ending ones, or something else? Have you seen this behavior using version 2.x when manually importing files after changing your git branch? |
No we have not seen this in 2.x after manual imports. I am trying to find out if it may be line endings that's causing this. It does look like line endings, but we have nothing set in git to change it. I am willing to let you connect to me and view the files, and see the behavior first hand. |
@ChrisJMarais I would expect you to have seen this behavior in version 2.x when you did a manual import. The code that performs the import, compile, and re-export is the same. The only change is when it is triggered (manually or automatic). |
@isc-bsaviano I was able to spend more time on testing and I found the following:
|
@spieriArtera Thanks for doing that research. I was mistaken about when the |
Closing because a product change isn't required |
We started noticing the following issue since updating to version 3.0.0, still having the issue on 3.0.1 :
If we run Import and Compile to compile all the source code, for example after cloning a repository or switching branch, many unchanged source codes are marked as changed and added to the changes list on Source Control on VS Code. This was happening also before version 3.0.0, but in the past we just had to select Discard All Changes on Source Control and the unchanged files were removed. Now after discarding the changes the code is recompiled and readded to Source Control, leaving us on a loop. The only workaround to remove them is to disable Compile On Save, Discard All Changes, and then re enable Compile On Save. Has something changed on the way Compile On Save works? What is the logic that adds unchanged files to the Changes list on Source Control?
The text was updated successfully, but these errors were encountered: