02-19-2013 06:41 PM
Discussion about LVMerge
GIT and LVMerge setup details:
https://decibel.ni.com/content/docs/DOC-2936/diff?secondVersionNumber=8
The setup strings for LVMerge and Diff look similar to this:
"c:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe" %base %mine %theirs %merged
"C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" %mine %base -nobdcosm -nobdpos
For file extensions: .vi, .ctl, .xctl, .lvclass, .lvlib
NOTE: that the merge and diff are in a shared folder and independent of the Labview
version. However, there are OTHER Labview version issues.
This is a useful, but slightly out of date tutorial, for Mercurial.
http://labviewwiki.org/Mercurial
READ THIS, note the date in October 2011.
https://docs.google.com/document/pub?id=1Lmx9WI1g_ObB03Vrlfb7QU3ochz1q_YRGM8dPi0R8g8
Video:
(Note: be sure to watch this in HD, not the default resolution).
http://www.youtube.com/watch?v=2dEI6tEMTmQ
http://forums.ni.com/t5/LabVIEW/using-github-for-version-management-for-Labview-VIs/td-p/1838121
http://lavag.org/topic/16300-how-should-i-set-up-git-for-labview/
https://github.com/joerg/LabViewGitEnv
https://sites.google.com/site/narasimhaweb/projects/arduino-labview-interface
http://www.chiefdelphi.com/forums/showthread.php?t=110080
#############################################################################
To replace a single file from the remote:
In windows explorer, goto the folder that contains the file to be checked out. Right
click, select Git Bash, then enter the string:
git fetch
git checkout origin/master <filepath>
<an example>
Mike@MIKE-PC-I7 /E/GitFolder/intrinsic/code/Program support (master)
$ git checkout origin/master "Create User Events.vi"
#############################
.gitignore
.aliases
.lvlps
/Built
/Build
What to do about them.
Also it's important to add *.lvlps and *.aliases to your ignore list, these files don't have a usefull meaning on another computer.
05-17-2013 03:58 AM
Hi,
one of our Customers is using Git but he had some issues with he tries to merge VI's. He has followed your guide but he receives Error 7 during merging VI's. Propably it's an configuration issue because Error 7 means that ther is a missing file. Attached you can finde a screenshot.
Has someone experiences with Git and merging? What can cause the issue?
Regards,
Philip
NIG
05-17-2013 05:27 AM
https://github.com/joerg/LabViewGitEnv works for me, but only from the git bash. I couldn't get diff and merge to work with git extensions
10-17-2013 04:44 PM
Actually the LVCompare works with Gitextensions. Even though it runs on the right click. LVcompare works. LVMerge fails. Please share your thoughts regarding configuring and LVMerge with GitExtensions or git??
thanks
12-30-2013 07:30 PM
I just finished setting up some custom work to make LVCompare/LVMerge work with VIs. I will probably make a separate post later to share, but in the mean time, the reason the above setup string fails with error 7 has to do with paths.
The first error is the order of arguments for LVMerge is actually: Base Remote(theirs) Local(yours) Merged.
The other note is LVMerge requires (I think?) full paths, and git doesn't automatically supply them. I wrote a bash script that alleviates this, but it requires some more tinkering to use fully with git. My current setup seems to work seamlessly from git bash, even with merges on more than one VI at a time.
Stay tuned...
01-16-2014 04:04 AM
>> For file extensions: .vi, .ctl, .xctl, .lvclass, .lvlib
I believe at the present moment neither LVMerge nor LVCompare support container file types such as xcontrol, classes, libraries and projects.
01-23-2014 01:50 PM
jpetrie, don't the variables $LOCAL and $REMOTE return the paths?
09-02-2014 04:14 AM
Well, I can't get LVMerge to launch without error 7. This is from SourceTree, the Git management frontend from Atlassian. I doubt it'll work anyway, merging classes and libraries isn't possible, so I'll only end up with a mess. Worth a try, but I think I'll leave this alone.
Even LVCompare balks when launched with errors regarding paths. It appears the variables $LOCAL etc do indeed return relative paths with an incorrect separator ('/' instead of '\') so the true VI location is not provided. Ridiculous.
09-02-2014 08:38 AM
Thoric wrote:
Well, I can't get LVMerge to launch without error 7. This is from SourceTree, the Git management frontend from Atlassian. I doubt it'll work anyway, merging classes and libraries isn't possible, so I'll only end up with a mess. Worth a try, but I think I'll leave this alone.
Even LVCompare balks when launched with errors regarding paths. It appears the variables $LOCAL etc do indeed return relative paths with an incorrect separator ('/' instead of '\') so the true VI location is not provided. Ridiculous.
Have you checked out this forum post yet? I don use TortoiseGit and i haven't run into any issues in getting merge/compare to launch.
http://lavag.org/topic/17934-configuring-git-to-work-with-lvcompare-and-lvmerge/
Once you get things working its still a pain no mater what source control methoud your are using. Labview just isn't built to merge/compare easily.
12-11-2015 06:47 AM
I confirm. Error 7 is a result of two things:
1. Git is a tool which comes from Linux. It is using slash and not backslash as a separator in paths. LabVIEW tools don't accept this.
2. Git is using relative paths. LabVIEW need absolute.
I also wrote a script to overcome this. It's a wrapper for diff/merge tools which recognizes if we work with .vi or other files. Based on that it decides if regular diff/merge tool or LabVIEW diff/merge tool should be used.
The script is written in Python3 and using Linux bash commands. This means that Python interpreter should be installed and added to PATH variable. Unix tools from MSysGit also must be added. Finally merge tools and mergewrapper also must be added to PATH.
To summarize, I recommend to add the following paths to PATH variable:
<pythondir>
<pythondir>\Scripts
<gitdir>\mingw64\bin
<gitdir>\usr\bin
<kdiff3dir>
<National Instruments>\Shared\LabVIEW Compare
<National Instruments>\Shared\LabVIEW Merge
<mergewrapperdir>
Script itself can be downloaded below:
Here is how to configure SourceTree to use the wrapper:
Tools -> Options -> Diff
External Diff Tool: Custom
Diff Command: mergewrapper.bat
Arguments: --diff $LOCAL $REMOTE
Merge Tool: Custom
Diff Command: mergewrapper.bat
Arguments: --merge $BASE $LOCAL $REMOTE $MERGED