01-23-2023 10:53 AM
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.
Enjoy.
01-23-2023 10:54 AM
Also Note: I've tested this with SourceTree and the CLI, but it should work with any Git Client.
01-23-2023 11:14 AM
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!
01-26-2023 07:29 AM
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
01-26-2023 08:34 AM - edited 01-26-2023 08:35 AM
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.
01-26-2023 08:51 AM
Makes sense, just noticed the URL in the git-bash command, but that is of course just a link to the files.
Thanks
Martin
01-26-2023 09:04 AM
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
01-26-2023 09:53 AM
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.
01-27-2023 08:54 AM
Martin I think you want to look at the .gitattributes file. I believe it lets you specify different difftools for different file types.
01-27-2023 10:32 PM
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.