LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
klessm1

Improve LVMerge and LVDiff for integration with third party SCM tools

Status: New

I have seen a few posts online indicating a couple of changes here and there for LVMerge and LVDiff.  I think the main problem is that we just want it to work with third party SCM tools like Mercurial / TortoiseHG, SVN / TortoiseSVN, RTC (Rational Team Concert), Surround, ect.  The ability to check in and out from project explorer is not quite cutting it.  With more and more developers using distributed SCC products like GIT or Mercurial the ability to merge and diff becomes really important.  Here is a list of what I would like to see in newer versions of LabVIEW and the LVMerge and LVDiff tools that would give us more time to develop code and less time spent managing software.

 

1. Both LVMerge and LVDiff work ok with a single vi, but not that well when hierarchies are different.  Most SCC applications will only download one file or the files that are different between change sets when merging or differencing change sets.  The basic problem is that in order to diff or merge LabVIEW requires the vi to be loaded which requires loading dependencies.  If the merge and diff tools didn’t require the vi’s dependencies to be loaded into memory then many of the issues just go away.

 

 I understand the technical challenges in order to implement this feature, but I think it would be a far better approach then trying to write a huge amount of code in order to handle multiple SCC tools.  Even if that code was written the workaround solutions are not pretty.  For example you would have to download both change set’s entire hierarchies to disk and then compare them.  How well will that work with very large projects?  Or with a merge where you need three version of the hierarchy?

 

I think the better solution is to just make LabVIEW files act like text files when diff and merges are performed.  The information in the LabVIEW file points to dependencies, and if those dependencies’s attributes change then flag them, but LabVIEW should be able to generate the LabVIEW "file" in a vacuum for differencing and merging.  May require caching more information about dependencies then what is currently saved in the vi, but I think that would allow a better merge / diff utility.

 

2. Support differencing and merging of all LabVIEW file types (projects, xctls, classes, libraries...).  Sometimes the text merge features in some programs don't take into account the complexity of the relationships between LabVIEW files.  It would be nicer to have a visual diff in terms of how LabVIEW treats the file (e.g. how TestStand differences sequence files).

 

3.  This is more of a bug fix, but improve the merge windows.  I have found a couple of situations where the code being merged is not even shown in the three windows (base, theirs, mine) and I cannot scroll to that location in the code to intelligently perform the merge.

 

4. LVMerge exe exits right away before the merge is complete.  TortoiseHG thinks the merge is complete for a file when the exe exits so it blows right past all of the other file merges so only the first file is merged.

 

5. Cover these use cases as differences between change sets when merging and differencing (item 1 solution should cover these):

Setup: use TortoiseHG to difference an entire change set in the repository with the local drive, or merge two change set in the repository.

  • Moved files (not just vi's) in the hierarchy
  • Deleted files in the hierarchy
  • Files added or removed from classes/libraries/projects
  • File 1 changed and dependency File 2 changes it's connector pane connection to work with the changes in file 1
  • Both new change sets add the same file that the base change set does not contain
  • Same as the last item, but added file has a different location on the hard drive between the change sets

There are probably more that I am not thinking of, but that would be a good start.

 

6. Simplify the entire process by providing a real IDE for merging and differencing files.  I am envisioning something with a hierarchy of views like Beyond Compare.  It would allow you to simplify some actions at a high level, but would give you the power to perform advanced actions.  For example, present a list of differences, types of differences, and the types of merges possible. 

  • Maybe some files can be auto-merged
  • SCC thinks the files were different but there are only cosmetic changes
  • User could choose between a deleted file or a changed file
  • Two versions are different but the user knows which one to choose without performing a merge.

The user should be able to have a quick view (no loading dependencies), or double click on the item and a new tab comes up that allows an actual file merge (vi, class, project, ect.).

 

 I think a tool like that that has the ability to interface with third party SCC tools would be a huge timesaver especially when dealing with distributed environments where merges occur more often.  It may need to stream all of the changes from a tool like TortoiseHG before performing a merge (probably easiest implementation), or rewrite the GUI for managing Mercurial or GIT change sets directly.

 

 The other option is to say "just use a check in check out central repository SCC", and I would say Phooeey! to that. Smiley Happy  After using Mercurial with TortoiseHG for a while I would not switch to anything other then another distributed SCC application...even with the difficulties with the merges and differences, using another system still poses similar problems (sometimes even worse) and the software management in those programs just stifles productivity.  Has anyone ever tried to move a class and its members to a different directory after the code has already been checked into an SCC tool like Perforce?  How about managing a multi-branch project where stable release updates are not only applied to the trunk but to a major feature branch?  Painful...

 

I think that these changes to the LabVIEW development environment will move us from “writing LabVIEW code” to “software development using LabVIEW”.

9 Comments
Imaginatics
Member

Hmm, there are times I really think Check In/Out/Lock is a good thing for project management. But I have to admit I too am becoming a fan of distributed SCC.  I hate merging with a passion, but being locked out of a VI someone else is working on is a nuisance as well and if they are unexpectedly gone for a weekend (and you're not an admin)...  well, I've had that happen way too often as well.  Still, kudo's to the post. You're asking for quite a bit of work out of NI to implement this kind of thing right.

Derv
Member

I agree it is time LabView contain tools that text based languages have supported for some time.

dpnsw
Member

Excellent Idea but it seems at this point, almost 3 years later, NI are not going to take this up for whatever reason.

 

It may be possible to get some of the functionality discussed here by using the LVHacker Source tools (see https://www.labviewhacker.com/doku.php?id=libraries:lvh_build-tools:lvh_build-tools ).

 

Granted it does require a few additional steps but might help some people.

klessm1
Member

I will checkout (no pun intended) this link. Thx.

 

TortoiseHG really improved their merge process since I created this idea which solves many but not all the items I listed. Instead of detecting one by one each item needing resolved it will download everything and give a list of items to resolve. At this point you can choose thiers or local or a merge tool. I have not really needed to use lvdiff or lvmerge since these features came out. I rarely get items to resolve because each developer usually keeps modifications to a few classes and there is communication on who is responsible for changing what (issue tracking software). When I do have to resolve I can usually use theirs or mine instead of merging. It really helps having classes to split up methods into separate files instead of state machines / action engines where the "methods" are in the same vi.

 

I still think some of the items would make software development easier, but I realize why NI would pass this up.

 

First of all the main premise is to "make it work". That statement right there means someone has to sit down and come up with a solution that probably has widespread effect on their code base. And the solution isn't cut and dried like changing a boolean constant's appearance.

 

Second, and most important, is that implementing these changes doesn't make NI money. Plus it costs them quite a bit of money to implement. There's maybe a couple cases out there where people will bring up "but it is difficult to diff and merge...we can't use LabVIEW". Which for me was three weeks ago...but with improvements I listed above it is no longer a real issue.

 

However if NI wants its g language viewed as a general purpose software language instead of play toy for engineers and scientists then they should probably start implementing some of these features that don't have short or even medium returns on investment.

 

LabVIEW is a very powerful tool. With some nicities for the software engineers it could be awesome. C# developers scoff. If we had some of the same features PLUS the ability to write code for an FPGA in a fourth generation programming language that would end the discussion right there.

thib_fr
Active Participant

Hello,

 

I would like to use labview with a git depot.

Is there any news since 4 years ?

What is the best interface for the user ?

thank you

klessm1
Member

 I find git extensions nice to use. Not much has changed with diff merge with LabVIEW, but we will see if NI invests a little into the NXG platform.  Saw a recent post on a user group discussion that you may want to check out. https://forums.ni.com/t5/LabVIEW-Architects-Forum/Tuesday-December-5th-2017-Agenda/gpm-p/3726354

Sumedha
NI Employee (retired)
Hi klessm1,
 
Thanks for your detailed feedback! In NextGen LabVIEW a VI doesn't know about its sub VI's paths. The project does the dependency management based on namespaces. This helps solve some of the integration challenges that LabVIEW has with scc like if a VI is moved on disk, the caller VIs aren't needed to be checked out and updated. 
 
We are also actively looking into improving workflows around using source code control like a compare utility that supports multiple file types and better integration with distributed clients like Git. Keep an eye on the LabVIEW NXG roadmap for more updates. : http://www.ni.com/pdf/products/us/labview-roadmap.pdf
 
-Sumedha
Sumedha Ganjoo | LabVIEW R&D
klessm1
Member

Thanks for the update!

Sumedha
NI Employee (retired)

Hi klessm1,

 

I wanted to provide another update on this. The Compare tool that ships with LabVIEW NXG 3.0 Beta has introduced project diff functionality. You can get access to it by signing up for NI Software Technology Preview. If you get a chance to try it and have any feedback, please feel free to share it on the LabVIEW NXG 3.0 beta forum or message me directly. 

 

Thanks,

Sumedha

Sumedha Ganjoo | LabVIEW R&D