01-04-2023 11:26 AM
Hi all,
I would like to know if it is OK to remove some items from LabVIEW project file XML. I am mostly doing this for cleaning the project file before a commit in GIT. For example I usually remove:
which I don't want to see in GIT history. For more info about what I am doing there is a video I presented in a LabVIEW User Group. The video is in French but slides and screenshots are in English and the main idea of the thing in understandable without sound I guess (https://www.youtube.com/watch?v=IKeNXx2Tqag).
I have an idea about the answer, the official answer (probably "just don't do that") and the under the hood answer (probably "at your own risk") but I would like to know point of view from other users and maybe NI R&D folks hanging around here. Maybe they are considerations I have not think about...
Thank you for your advices!
01-04-2023 12:43 PM
@Nicolas_Bats wrote:
Hi all,
I would like to know if it is OK to remove some items from LabVIEW project file XML. I am mostly doing this for cleaning the project file before a commit in GIT. For example I usually remove:
- Dependencies items
- PersistantID
- Some FPGA very long strings items
- ...
which I don't want to see in GIT history. For more info about what I am doing there is a video I presented in a LabVIEW User Group. The video is in French but slides and screenshots are in English and the main idea of the thing in understandable without sound I guess (https://www.youtube.com/watch?v=IKeNXx2Tqag).
I have an idea about the answer, the official answer (probably "just don't do that") and the under the hood answer (probably "at your own risk") but I would like to know point of view from other users and maybe NI R&D folks hanging around here. Maybe they are considerations I have not think about...
Thank you for your advices!
I muck around in there some, mainly to copy build specs from one project to another. I personally don't think what you're doing is particularly dangerous, especially since you're using versioning software. I'm just not sure the risk-to-reward ratio is there. Why risk project file corruption to delete some stuff that LabVIEW will just re-add anyway?
01-04-2023 10:17 PM
I never alter the LabVIEW project file outside of LabVIEW.
I scanned parts of the video and I get an idea of where you are headed. Interesting.
Where in the video do you mention the long FPGA strings?
01-05-2023 03:37 AM - edited 01-05-2023 03:39 AM
I don't think it is safe. I have occasionally removed some VIs from a project in that way because I couldn't load the project anymore when they were present and I have pre-build scripts to update version information and such, but that goes through the LabVIEW scripting interface whenever possible.
I recently had a case where a project would not load anymore and a version comparison with the latest version from the version control system indicated only the addition of three VI files used for a minimal unit test setup. I couldn't immediately see where there would be an XML syntax error but something was clearly off. After removing the section with those new entries, the project could be properly loaded. I didn't investigate further, simply readded those VIs and it works since without problems. But it clearly shows that even minor mistakes in the XML structure can apparently throw the loader totally off. And some of the information is not self contained but relates to other parts in the project file, so inconsistencies could also happen in such a way.
Personally I would consider such modifications definitely dangerous and the gain of not having some supposed clutter in the SCC not worth the time and effort.