LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving from svn to git


@cirrusio wrote:

Sorry, I am not following your 'parent' structure comment.  If you can teach me how to code such that LV is completely agnostic with regards to the directory structure, that would be great.  But, to be honest, I am not entirely sure how that is possible.  For instance, when I place code in two places, directory A and directory B (both at the same level), and the code in A references the code in B, LV will always look at that same level for the code in B when opening A.  If I the code in B to some place else, viola!, my code in A pops up with all kinds of missing VI errors.  And that makes sense to me.  So the absolute path is not of central importance (I manage other projects that use gh and don't have to duplicate absolute paths to get everything to compile), but the relative paths are. 

And that is what I need to duplicate so that everything does not break.  I don't really care where a user puts the code they have pulled, I just need to make sure that A and B maintain their relative placements.


This was largely what I meant - that you can have A and B be separate repositories which rely on being at the same level. Is there a reason you need to be able to move them around? Supposing in the case you described when replying to Matt, you have 'Instruments', 'Devices' and 'Reusable', then perhaps you can instead have all of your top level folders be 'Inst1', 'Inst2', 'Dev1', 'Dev2', 'Reusable' and each correspond to a separate repository. I'm uncertain how many instruments or devices you have - perhaps these all being top-level would make too much of a mess of your directory.

 

My comments regarding using something like the 'default data directory' were to enable the use of these from some other part of the file system. Suppose you have 'Inst1', 'Inst2', 'Dev1', 'Dev2' and 'Reuseable' all as top level directories in your 'LabVIEW Data' folder. If you want to write a new project, you can reference it without the use of '../Dev1/Dev1Main.vi' and instead just have 'Default Data Dir' + 'Dev1/Dev1Main.vi'.

 

If you wanted to have some different structure, you could consider perhaps a VI in your reuse folder that specifies the parent directory. Then you could call 'GetParentDirectory.vi' + 'Dev1/Dev1Main.vi' or similar.

 

I can't think of a way that you can find a repository without any knowledge of its location in the file system (beyond perhaps searching everywhere, which presumably you wouldn't ever want to do). If you have a directory (any) into which you place all of your repositories when cloning them, you can use a method like I described.

 

If you want to arbitrarily locate your repositories, then perhaps you can use a config file listing the top-level directory for any repositories you need to load. This is slightly messy, but should only need to be changed when you pull in new repos or move directories on disk. Just don't move the config file, or anything looking for it will also need updating, at which point you lose any benefit you were trying to create.


GCentral
0 Kudos
Message 11 of 14
(607 Views)

(Sidenote - the discussion system here is terrible and I will never understand why NI went this route; the quoting mechanics are abominable)


@cbutcher wrote:

This was largely what I meant - that you can have A and B be separate repositories which rely on being at the same level. Is there a reason you need to be able to move them around?


Would be nice to be able to provide code to others - and I have no way of enforcing the cloning process without a script so I can not guarantee that all will go into the LV Data Directory.

And so, after reading your message again I have to emphasize this - I DO NOT WANT TO RESTRUCTURE MY ENTIRE DIRECTORY THAT CONTAINS ALL OF MY REPOSITORIES.  Sorry that is in all caps, but that is incredibly important.  Yes, if I was doing this from scratch, I might have tailored my structure differently to fit the git paradigm.  And I might have even had a fighting chance to use vipms or ppls.  But I didn't.  And now, referring back to the first post, I am attempting to move a decade's worth of projects (10 or 15 different applications - instruments) from a subverison monorepo to one that can fit into the git paradigm.

Besides, restructuring the directories does not fix everything associated with this issue - dependency management is a pain and duplication always a danger.  To be honest, all of these are good ideas, but they still don't address the management of multiple applications utilizing a common codebase. Submodules would be ideal, but they aren't well implemented in git.  That's why there are tools out there that try to improve on certain aspects of that functionality. 

But, now you have me thinking and I am going to take another stab at this tomorrow and see if I can come up with a better answer...

Cheers

0 Kudos
Message 12 of 14
(604 Views)

So, I think that I am going to go with the repo tool.  Not as straightforward in Windows to use, but still not a problem if you have git bash.  Here is an article discussing pros and cons of different approaches and why you should not be using git submodules:

 

https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/

 

When I get things put together, I will provide a link so anyone who is interested can check it out.

 

Cheers

0 Kudos
Message 13 of 14
(587 Views)

Interesting link - I've also found git submodules frustrating whenever I've had to use them, but I've never tried managing a project with them, which is presumably far more trouble.

 

If you don't want to split the directories out from each other then I think it will be difficult to really make them independently usable. Still, it sounds like you have a plan in place, so good luck!

 


cirrusio wrote:

When I get things put together, I will provide a link so anyone who is interested can check it out.

 


Looking forwards to reading it!


GCentral
0 Kudos
Message 14 of 14
(580 Views)