Git User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Easiest Way to Setup LVCompare and LVMerge

Setting up LVCompare and LVMerge can be a pain.

 

Here is a way to do it by simply copying a few lines and pasting them in GitBash.

 

https://youtu.be/655eiaVXoiA

 

Enjoy.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 1 of 12
(3,992 Views)

Also Note: I've tested this with SourceTree and the CLI, but it should work with any Git Client.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 2 of 12
(3,989 Views)

If anyone doesn't want to bother watching the video and clicking through, here is the code snippet to drop into Git Bash. It is literally that simple.

 

cd && git clone https://gitlab.com/sas-blog/LVCompare-Merge-Setup.git && cd LVCompare-Merge-Setup && ./setupLVTools.sh

 

Of course, this clones a git repo and runs a shell script on your computer, so if you care about security you should probably go look at the code and make sure it doesn't do anything malicious (it doesn't). The code is pretty simple and easy to understand - except for one magic function that converts the windows path to a linux path using the tr command. I copied that from somewhere else (credited in the header of the script). It's black magic, but it works!

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 3 of 12
(3,964 Views)

Hi Sam

 

Our company has a very strict security policy, which means that my git-bash is not online, but has connection to our local Bitbucket server. Is it possible to set this up for offline use?

 

Cheers

Martin

0 Kudos
Message 4 of 12
(3,903 Views)

You can download the files manually by some other means and then run them from within your git bash. All you really need are the 3 .sh files.

~ Self-professed LabVIEW wizard ~
Helping pave the path to long-term living and thriving in space.
Message 5 of 12
(3,897 Views)

Makes sense, just noticed the URL in the git-bash command, but that is of course just a link to the files.

 

Thanks

Martin

0 Kudos
Message 6 of 12
(3,887 Views)

Related question, is it not possible for Sourcetree to use different external diff tools for LV and TS? It is cool to have this for LV, but is it possible, somehow, to add a diff tool for TS sequence files?

 

Cheers

Martin

0 Kudos
Message 7 of 12
(3,880 Views)

One thing to note here is that when the remote file gets renamed in this script, git is no longer able to clean it up.  So, you will end up with a whole bunch of temporary files that will never get removed.

 

One idea I've been wanting to implement for a while now is to somehow keep the bash script alive while lvcompare is open and then when it closes, we can rename the file back so that git can clean it up.  I just haven't had time to dig that much into it.

 

It's unfortunate that Git changed how they generate the temporary files (renaming the folder instead of the file).  If you're curious, it was changed in this commit of the git source code.

0 Kudos
Message 8 of 12
(3,873 Views)

Martin I think you want to look at the .gitattributes file. I believe it lets you specify different difftools for different file types.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 9 of 12
(3,840 Views)

The .gitattributes file lets you set an external diff driver for specific files.  These call an external function but with different parameters than what it uses for difftool.  So, it's basically the same script, just need to pull different parameters.  I had to use a strange workaround to even get Git to recognize that the bash script file existed at all by adding a dummy parameter to the command:  "command = /c/path/to/script/myScript.sh dummy" and the 7 parameters are shifted by 1.  Not sure if this is just me.

0 Kudos
Message 10 of 12
(3,821 Views)