10-12-2022 09:23 AM
Hi,
three of us use GIT to develop the same labview project. We try separating the sections we work on, so in most of the cases we dont have a merge conflict on the VI level but because the lvproj file changes pretty much by each change we make, we have an issue merging our work seamlessly. Is there a straightforward way to merge project files?
The same question asked here >>>HERE<<<8 years ago.
Pls note: this is about merging lvproj files only, not about how to merge VIs
Thanks!
10-12-2022 10:06 AM
Short answer: Don't.
10-12-2022 10:22 AM - edited 10-12-2022 10:24 AM
@1984 wrote:
Hi,
three of us use GIT to develop the same labview project. We try separating the sections we work on, so in most of the cases we dont have a merge conflict on the VI level but because the lvproj file changes pretty much by each change we make, we have an issue merging our work seamlessly. Is there a straightforward way to merge project files?
The same question asked here >>>HERE<<<8 years ago.
Pls note: this is about merging lvproj files only, not about how to merge VIs
Thanks!
I've noticed that if you keep to your respective libraries, even if the project file wants to be saved, it doesn't actually change in content. Not sure why it even wants to save, but it does. GIT never considers these saves to be changes. This is as designed; all the changes to the library are recorded in the lvlib file.
The problem is when you actually add something to the project, like a new library or dependency, or a build's property changed somehow. You should tell GIT to treat lvproj and lvlib files as binary so it doesn't try to be smart and try to merge them for you. You will then end up with a conflict instead. Usually you can look at the contents of the files to see which one represents the best choice. Sometimes you can even merge them by hand. I've done this before.
10-12-2022 02:32 PM
@billko wrote:
@1984 wrote:
Hi,
three of us use GIT to develop the same labview project. We try separating the sections we work on, so in most of the cases we dont have a merge conflict on the VI level but because the lvproj file changes pretty much by each change we make, we have an issue merging our work seamlessly. Is there a straightforward way to merge project files?
The same question asked here >>>HERE<<<8 years ago.
Pls note: this is about merging lvproj files only, not about how to merge VIs
Thanks!
I've noticed that if you keep to your respective libraries, even if the project file wants to be saved, it doesn't actually change in content. Not sure why it even wants to save, but it does. GIT never considers these saves to be changes. This is as designed; all the changes to the library are recorded in the lvlib file.
The problem is when you actually add something to the project, like a new library or dependency, or a build's property changed somehow. You should tell GIT to treat lvproj and lvlib files as binary so it doesn't try to be smart and try to merge them for you. You will then end up with a conflict instead. Usually you can look at the contents of the files to see which one represents the best choice. Sometimes you can even merge them by hand. I've done this before.
I agree. Use libraries and/or classes to separate things and the top level project will not need to be changed often. Each developer would work within a library and therefore their work is self contained and will not conflict with the other developers. I've been doing this for years now and we have very little conflicts within a team of several developers.
10-13-2022 10:06 AM
Try this.
10-13-2022 10:40 AM
Usually it's the .Alias file. MyComputer is not the OtherDevolpers computer. Just excluding *.Alias from SCC repository fixes that.
01-04-2023 11:13 AM
because the lvproj file changes pretty much by each change we make, we have an issue merging our work seamlessly.
As mentioned above, the use of libraries helps to reduce the number of modifications into the LabVIEW project file, but it's not always enough. Some changes may have to be done in the project file (eg: build specification change) and versioned in the source code control system.
Is there a straightforward way to merge project files?
I wouldn't say "straightforward", committing the entire project file is the best way to get conflicts and corrupted LabVIEW project files.
For me the best way is to cleanup the content of the LabVIEW project file to remove all information generated by LabVIEW (ex: dependencies) and only retain the interesting content for you (eg: statically linked VI, symbols, build specifications...). The LabVIEW project file is an XML text file. If you only keep strict necessary information inside, version management tools like SVN or GIT then do a very well job to merge changes inside the project file.
This cleaning task can be done manually but it is very laborious and repetitive, it can also be scripted. If you are interested in more information I have made a presentation about this subject recently during a LabVIEW User Group meeting (https://www.youtube.com/watch?v=IKeNXx2Tqag&t=34s). The presentation is in French but slides and screenshots are in English.
Disclaimer: Warning this is not an official solution, it's just a workaround that I use.
01-04-2023 12:46 PM
@Nicolas_Bats wrote:
because the lvproj file changes pretty much by each change we make, we have an issue merging our work seamlessly.As mentioned above, the use of libraries helps to reduce the number of modifications into the LabVIEW project file, but it's not always enough. Some changes may have to be done in the project file (eg: build specification change) and versioned in the source code control system.
Is there a straightforward way to merge project files?
I wouldn't say "straightforward", committing the entire project file is the best way to get conflicts and corrupted LabVIEW project files.
For me the best way is to cleanup the content of the LabVIEW project file to remove all information generated by LabVIEW (ex: dependencies) and only retain the interesting content for you (eg: statically linked VI, symbols, build specifications...). The LabVIEW project file is an XML text file. If you only keep strict necessary information inside, version management tools like SVN or GIT then do a very well job to merge changes inside the project file.
This cleaning task can be done manually but it is very laborious and repetitive, it can also be scripted. If you are interested in more information I have made a presentation about this subject recently during a LabVIEW User Group meeting (https://www.youtube.com/watch?v=IKeNXx2Tqag&t=34s). The presentation is in French but slides and screenshots are in English.
Disclaimer: Warning this is not an official solution, it's just a workaround that I use.
Oh, here's my answer to my question in the topic you made.