Question
· Dec 10

Git Source Control not tracking CSP changes

Hey everyone, I am implementing version control with git-source-control on our codebase and I ran into a pretty strange issue. I believe I have the set up (mostly) correct as the behavior with .cls files is exactly as expected. However, I noticed that git is not keeping track of any changes to CSP files.

Specifically, if a new CSP file is created and saved, I will get the following output:

exporting new version of /csp/testdb/wrc.csp to C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\wrc.csp

Added /csp/testdb/wrc.csp to source control.

C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\wrc.csp removed from uncommitted list

exporting new version of /csp/testdb/wrc.csp to C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\wrc.csp

Added /csp/testdb/wrc.csp to source control.

C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\wrc.csp removed from uncommitted list

However, if I change a CSP file and save it, it simply compiles with no exporting, and git is unaware of any changes. I can neither see the change when running git status nor git add the file. When I went digging in the git repository location, the csp file is indeed completely unchanged (but the CSP files stored in /csp/ have changed). This is different to the behavior I observe when making changes to a .cls file. When I change a .cls file and save those changes, the output is as follows:

exporting new version of PET.DataFile.CLS to C:\InterSystems\IRIS\mgr\repo\PETDB\cls\PET\DataFile.cls

and git becomes aware of the change. 

Has anyone else seen this problem before? Did I neglect to turn on a setting somewhere? I have a sneaking suspicion that this might have something to do with server vs client side editing, but I did follow the official documentation around defining workspaces and I also made sure that there wasn't conflicting local folder settings. Any ideas would be much appreciated. Thanks! 

Product version: IRIS 2022.3
Discussion (8)2
Log in or sign up to continue

The only non-default mapping is for CSP. 

/CSP/ /csp/testdb csp/testdb/

The entire workspace definition is as follows:

{ "folders": [ { "uri": "isfs://local-test:TESTDB/csp/testdb?csp" }, ], "settings": { "objectscript.conn": { "active": true }, "objectscript.showExplorer": false } }

The .vscode subdirectory is empty

What perplexes me is how it knows about new and deleted files, but not any file changes. 

If it matters, I manually added these files with git add before knowing about baselining and at the time the workspace might not have been defined properly. Do you think that could have broken something? 

Edit: I tried again in a new namespace and used a properly defined workspace, and the same issue persists, so it's probably not an initial workspace definition issue. 

I still haven't figured out exactly what is causing this behavior, but I have found a fix: export all (force) forces a sync so CSP changes become known to git. Not the most ideal or elegant fix since I have to export every single file every time, but it works. Note that the normal export does not work. 

From my cursory glance at the code base, this seems to suggest that something is off about the "IsTempFileOutdated" function in the "ExportItem" function. I suspect it's returning false for me even though it should return true. Would love your thoughts on this!

Are your new CSP files being added to source control properly? I'm trying to reproduce your issue, but when adding a new csp file, get the output 

exporting new version of /csp/testdb/wrc.csp to C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\rc.csp

(i.e. the wrc.csp file is exported as rc.csp). Does this happen to you as well? Seems from your output it isn't but just wanted to check)

Adding to source control seems to be fine on my end. The only weird thing is the output always come in duplicate (i.e. it tells me that it's been added twice, like the example in the post). Also, the new CSP files are added automatically for some reason - upon creating and saving, I don't need to run git add for it to be added. It completely skips over being untracked. 

I'm also noticing that it says "C:\InterSystems\IRIS\mgr\repo\TESTDB\csp\testdb\wrc.csp removed from uncommitted list" whenever I save changes in a CSP file, but that's the only output.