05-08-2017 10:18 PM
Sorry for resurrecting an old post but it seemed to be on more or less the same topic.
I recently added an item to the private data of a class which has direct or indirect links with most of the project. All of the VIs/classes/libraries and the project file have Separate Compiled Code checked, and in the project view, everything is marked (apart from 2 demo VIs provided by a vendor, but these are really tangential and don't play a part in the project really).
Despite this, nearly all of my VIs were marked as changed by git after a Save All in Project (which recompiled many VIs, I think). Is this expected? (Some had no connection to an object of that class, although they might be linked to Actors who used VIs of that class which didn't require the class object input/output).
More confusingly to me, if I use 'git stash' to save all the changes without committing them, and then reopen the project, several (probably the same ones) VIs were again recompiled, but only the lvproj file needed to be saved, and 'git status' now only shows the lvproj file as modified. This is a simple workaround, but I wonder if it should work, and if so, why it is necessary?
05-10-2017 09:15 AM
Hi @cbutcher,
I'm not an expert in this, but after doing some research, I would think it should be expected as all files in a project are inherently linked. Here is a little better interpretation of the following git commands I found to help clarify:
1. git reset --hard <commit number> => Makes the HEAD point to the <commit number> all the commits after the commit pointed by <commit number> will be lost.
2. git reset --hard origin/master => HEAD point to the initial state(The original code on the machine).
3. git stash => Similar to shelve in TFS(but its local)
4. git stash pop => Similar to unshelve in TFS(but its local)
I hope this helps!
05-10-2017 09:28 AM
Hi Letitsnow,
Thank you for the response. I was more confused as to why changing private data of a class marked all (or nearly all) of my project files as modified, but then when using 'git stash' to more-or-less unmodify them, resetting them to the state of the last commit (i.e. before the addition to the class' private data) and reopening LabVIEW didn't again remark them as modified.
Essentially my confusion lies in the fact that LabVIEW (or git) felt the need to mark the (unmodified, at least directly) files as modified in the first case, but not in the second. If there was no change, I don't understand why git marked all of the files - if there was a change, I don't understand why LabVIEW didn't immediately change them again on reopening and saving all.