Popular Post Aristos Queue Posted August 4, 2021 Popular Post Report Share Posted August 4, 2021 There are many links on the Internet to tell you how to configure git to use custom tools for VI. Many are wrong. Yesterday, I and another developer outside NI worked through the sequence and got it working repeatably on both of our machines. Here is the process. Save both of the attached files someplace permanent on your hard drive that is outside of any particular git repo. We used C:\Users\<<username>>\AppData\Local\Programs\GIT\bin _LVCompareWrapper.sh_LVMergeWrapper.sh Modify your global git config file. It is saved at C:\Users\<<username>>\.gitconfig You need to add the following lines: [mergetool "sourcetree"] cmd = 'C:/Users/smercer/AppData/Local/Programs/GIT/bin/_LVMergeWrapper.sh' \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\" trustExitCode = true [difftool "sourcetree"] cmd = 'C:/Users/smercer/AppData/Local/Programs/GIT/bin/_LVCompareWrapper.sh' \"$REMOTE\" \"$LOCAL\" [merge] tool = sourcetree [diff] tool = sourcetree That's it. There are lots of ways to edit the .gitconfig from the command line or by using SourceTree's UI... if you know those ways, go ahead and use them. 4 Quote Link to comment
ShaunR Posted August 4, 2021 Report Share Posted August 4, 2021 The link in the *.sh files for an explanation of the cmd options does not work so I've posted them here FYI. Quote LVCompare.exe Use the Windows command line to start the LVCompare.exe utility. In the command line, type the following: lvcompare.exe <absolute path to VI 1> <absolute path to VI 2> [-lvpath <path to LabVIEW>][-noattr][-nofp][-nofppos][-nobd][-nobdcosm][-nobdpos] -noattr means do not compare VI attributes -nofp means do not compare the front panels -nofppos means do not compare the size or position of front panel objects -nobd means do not compare the block diagrams -nobdcosm means do not compare the appearance of block diagram objects -nobdpos means do not compare the size or position of block diagram objects. Note: Comparing VIs with the same name is not supported by the LVCompare.exe utility. 2 Quote Link to comment
Stagg54 Posted July 29, 2022 Report Share Posted July 29, 2022 Those original scripts will no longer work with new versions of Git. In newer versions the 2 files being diffed will have the same file name. The script needs to account for that condition and rename the remote file. I have a created a similar bash script here that accounts for that. https://gitlab.com/sas-blog/LVCompare-Merge-Setup 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.