Custom QuickDrop Shortcut - Git Diff/LVCompare

Do you use the LVCompare diff tool? I do, all the time now.

If you haven't used it before, it's like playing spot the difference between 2 versions of the same VI but LabVIEW will list what is different and take you to the location of the differences. It's great.

My favourite uses are:

  • Double checking before committing files that what I think I changed is what I actually changed, to make sure I have good commit notes and didn't do anything by accident
    • Especially when I see a file listed that I didn't think I did any work on... This normally results in reverting it after checking what the difference is!
  • Understanding what someone actually changed, usually when doing code reviews or pull requests
  • If I find what looks like 2 versions of the same file, checking they are actually the same.
I had the tool set up to work with my Git GUI of choice, TortoiseGit. I would normally run it by navigating to Windows Explorer, right clicking on a file or a log entry and selecting which file versions to diff, as shown below.


Diffing the working tree with 2 revisions ago

But I found that, even with the Show VI in Windows Explorer QuickDrop shortcut installed, it still felt like a few clicks too many to do a simple diff. So I decided to write another QuickDrop shortcut to make it effortless. It's nothing fancy - it just calls TortoiseGit to open a directory in the log using command line options. The directory in question is by default the VI that you have open, but can also be used on a VI's folder, library, repo, class, library or project as described in the documentation.

Here it is in action:


You can download the QuickDrop Plugin from vipm.io here, or from the NI Forums here if you want a LabVIEW 2014-2017 version. 

It's open source too. You are welcome to contribute and the repo is linked to from those places. If there is the demand for it, I could try make a TortoiseSVN version.

Enjoy.

Edit 04/01/2023: I made a 7 minute presentation on this topic which can be found on YouTube.


Comments