Hi
I am having issues with setting up labview merge and compare tools as external tools in sourcetree 3.0. The documentation I found was for pre 3.0 versions. It should be possible to set up an externel merge tool by clicking tools > options > diff ? I can then set the path to the relevant VI's, but I am not sure this is the right approach? At least it does not seem to work.
Peter
I found that NI is providing a LabVIEW based solution to the LV Compare and LV Merge tool arguments issue. They have provided the LabVIEW code in a GIT repository. I just downloaded it and followed the instructions for building the EXEs, distributions and installer on my system and change the Sourcetree Diff and Merge callouts as specified.
I plan to try out the previous steps I implemented changing code in two local repos that point to the same remote repo, simulating two developers working on the same VI and committing/pushing in order to generate a conflict and then seeing if the tools will work as specified to leverage the Compare and Merge tools.
Here is the link to the GIT repository provided by NI: https://github.com/smithed/vicompare
Thank you very much, Ryan! I have tested both tools, and they seem to work perfectly!
The only problem I had was, when I tried to launch the external compare tool from sourcetree the first time. Labview complained that several files were not part of the project, so I clicked "add to project". This seemed to set the project in a weird state, so I closed the project without saving the changes. When I tried to launch the compare tool a second time, there was no problem. Unfortunately I did not grab a screenshot, but the problem seems to have went away. When I then tried to luanch the external merge tool, there was no problem.
I am surprised to see that this code apparently is 4-5 years old. Do you have some contact information of the guy who put up the code? Is he from NI?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad that it worked for you too. I had a small issue the second time I stepped through - but that was due to me using a trial copy of LabVIEW on the PC I am using to evaluate Bitbucket and Sourcetree along with JIRA and Confluence, etc.
Daniel was the original poster of the page on NI.com that pointed me to the solution. You can message him through that forum, as it doesn't look like Github allows contact of members. He is from NI. The page is kind of buried on the NI website which is probably why so many people are missing the solution when they do a web search or even a search on NI website for Sourcetree.
https://forums.ni.com/t5/Reference-Design-Content/Getting-Started-Git-and-GitHub-setup/ta-p/3544824
This is his profile:
https://forums.ni.com/t5/user/viewprofilepage/user-id/163300
About halfway down the left ribbon is a Contact Me panel with a button for sending a Private Message. I just sent him one thanking him for the post. Hopefully he responds.
Ryan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all, I'm glad that tool is working well for you. I mentioned to ryan that I was making this a while back when I was trying to push for github use for my old group. Thats also how that doc on the reference design portal came about.
Another possibly useful script you may not be aware of is https://github.com/joerg/LabViewGitEnv/tree/windows
I tried using it at the time (and even branched it) but got frustrated, hence my version, but it looks like someone had spent some time contributing to it a few years ago -- so maybe my frustrations were resolved. I admit I had and still have 0 knowledge of the finer points of bash scripts, let alone bash scripts running in the git terminal on windows.
Some other things worth mentioning:
If you do see a specific issue in practice, feel free to put an issue on the repo. best case I fix it, worst case other people can know about it.
-Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Daniel,
Thanks for the reply and passing on the knowledge. I will also check out the joerg linked github .sh script solution to see if I like it as well.
For everyone that might not be aware - you can modify the arguments for LV Compare on the Tools>Options>Diff set-up.
The valid arguments can be found here:
http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/configlvcomp_thirdparty/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, at the time I didn't want to have the exe call the exe for some reason, but I can't remember exactly why. It should be easy to hack those pieces together if you want it to work that way. One possible reason I did this is that I used some private methods to make sure each VI gets its own application context to avoid issues where the two VIs being diff'd have the exact same namespaced name -- I don't think git does this, but maybe mercurial did? Anyway, point is I just called the labview diff and merge methods directly, rather than fixing the paths and calling into the exe.
So....while I exposed those flags as optional parameters on the 'black box' diff and merge methods, I never implemented them as part of the parsing, and the code (wrongly) treated every flag left over as a path it needed to fix.
I just spent a little while shoving together a few small fixes to the above. I gave it a quick test to make sure the basics still worked, but I probably won't get around to doing a more complete test for a while. Its now pushed to my github if you want to take a look and give it a try. Its a bit of a rush job but not too bad.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for even looking at it.
I branched my forked code and added a LV Dialog pop-up to allow me to change the settings each time I Diff, or I can turn it off in vidiff.ini and then run with the settings from vidiff.ini. It seemed easier to me to do it that way than edit the Tools>Options>Git settings.
Mercurial might act differently, I am not sure. I've used it in the past, but we rarely used Diff functionality and I didn't have to dig into it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have been looking into this as well since I am evaluating Atlassian tools for Version Control with LabVIEW. I am seeing the same issue. I tried looking around for solutions as the ones I found were for Sourcetree prior to version 3.
Sourcetree is a very nice GUI for working with Git and I like that Sourcetree has embedded GIT so that makes adoption by my coworkers more likely.
It seems that others have solved the problem posted by writing scripts to provide LabVIEW Compare and LabVIEW Merge with the Absolute Paths to the argument file locations. I tried the one posted by Endigit and it did not work.
Was hoping to see this was solved here...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello! There was a bug in custom diff tools recently that caused this to not work quite right (you can find the fixed version here)
After updating, you should be able to try the following:
"External Merge Tool" set to "Custom"
"Merge Command:" set to:
PATH TO 'LVMerge.exe' goes here
"Arguments" set to:
\"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike
Thanks for your reply! It seems to be more right now. However, it is not quite working yet. I have made a change to a file called "xxx.vi". In the "file status" tab I hightlight the file at hit ctrl+d to launch the external diff tool. Labview compare then launches with the error message seen below. Is there somewhere in sourcetree I can set the exact command that is executed, or how can I fix this problem?
When I try to resolve a merge conflict using the external merge tool, labview opens with the error seen in the attahced picture. Perhaps incorrect parameters are causing this problem as well.
LVCompare was called with incorrect parameters.
How to call LVCompare:
LVCompare <absolute path to vi1> <absolute path to vi2> [-lvpath <absolute path to LabVIEW>] [-noattr] [-nofp] [-nofppos] [-nobd] [-nobdcosm] [-nobdpos]
[-lvpath <absolute path to LabVIEW>] - Provide the path to the LabVIEW executable you want to compare the VIs
[-noattr] - Do not compare VI attributes
[-nofp] - Do not compare Front Panel
[-nofppos] - Do not compare Front Panel objects' position/size
[-nobd] - Do not compare Block Diagram
[-nobdcosm] - Do not compare Block Diagram objects' cosmetics
[-nobdpos] - Do not compare Block Diagram objects' position/size
Example:
LVCompare c:\test\apple.vi c:\test\orange.vi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike
Thanks for your reply! Something seems to work better now. However, it does not quite work yet. I tried to make a change to the file "xxx.vi". In the tab "file status" I highlighted the file and pressed ctrl+d to launch the external diff tool. Labview compare then opens and gives the error message seen below. Is there somewhere I can set the exact command executed by sourcetree, or how can I fix this problem?
When I try to resolve conflicts in a merge with the external merge tool, labview open and gives the error message seen in the attached picture. Perhaps It is due to incorrect parameters as well.
LVCompare was called with incorrect parameters.
How to call LVCompare:
LVCompare <absolute path to vi1> <absolute path to vi2> [-lvpath <absolute path to LabVIEW>] [-noattr] [-nofp] [-nofppos] [-nobd] [-nobdcosm] [-nobdpos]
[-lvpath <absolute path to LabVIEW>] - Provide the path to the LabVIEW executable you want to compare the VIs
[-noattr] - Do not compare VI attributes
[-nofp] - Do not compare Front Panel
[-nofppos] - Do not compare Front Panel objects' position/size
[-nobd] - Do not compare Block Diagram
[-nobdcosm] - Do not compare Block Diagram objects' cosmetics
[-nobdpos] - Do not compare Block Diagram objects' position/size
Example:
LVCompare c:\test\apple.vi c:\test\orange.vi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm... seems like you might need to add the absolute path to the LabVIEW exe in the parameters? Could you try the following?
\"C:\program files\PATHTOLABVIEW.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get the same error message, when I try to run the external diff tool. You can see my inputs to the diff options below:
Diff command:
C:\Program Files (x86)\National Instruments\Shared\LabVIEW Compare\LVCompare.exe
Arguments:
\"C:\Program Files (x86)\National Instruments\LabVIEW 2018\LabVIEW.exe" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
Merge command:
C:\Program Files (x86)\National Instruments\Shared\LabVIEW Merge\LVMerge.exe
Arguments:
\"C:\Program Files (x86)\National Instruments\LabVIEW 2018\LabVIEW.exe" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.