version control for macro development

Programming and macros
User avatar
mp3-250
Posts: 535
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 595
x 274

version control for macro development

Unread post by mp3-250 »

I am developping quite some tools for our sw pdm and cad.
swp macros, batch files, mainenance of registry files and various TASK scripts.

At the moment I keep copy of every official release on my disk with rel number in the file name and when I make some modifications I copy and rename the latest with a new number and a wip at the end. As the editing proceed I take some backup copying the current file and appending a sequential number as extension (i.e..000 .001 .002 etc)

It is not optimal and I would like to work with something like PDM, but I do not want to put those files Inside our vault or create a new vault as i need to access the production or the test vault from the same machine while loading a macro from a network drive. also our production and test vaults share the same id so i need to use different machines to access them or wipe the local view every time, so I prefer to have them out of PDM if possible.

I read the SVN or git does not work with swp macros and my understanding of swb macros is they are quite limited as I use multiple modules and forms.

Any suggestion?
User avatar
JSculley
Posts: 574
Joined: Tue May 04, 2021 7:28 am
Answers: 52
x 7
x 806

Re: version control for macro development

Unread post by JSculley »

Switch to C# or VB.NET. They are far more powerful languages and you can use git with them.
User avatar
SPerman
Posts: 1819
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 13
x 2003
x 1677
Contact:

Re: version control for macro development

Unread post by SPerman »

How easy is that to do? I've seen threads where users haven't been able to get Microsoft VSTA and Solidworks happy.

viewtopic.php?t=3113

viewtopic.php?t=1967
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
AlexB
Posts: 434
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 21
x 240
x 383

Re: version control for macro development

Unread post by AlexB »

I've migrated all of my projects to c# using visual studio community for development and github for version control. Github is a game changer when compared to storage of copies on a network drive.

I do have some .swp macros and those are stored in a PDM folder that users cache latest on login. Macros are just not as easy to work with but some cases take less time to create compared to the c# equivalent.
User avatar
bnemec
Posts: 1848
Joined: Tue Mar 09, 2021 9:22 am
Answers: 10
Location: Wisconsin USA
x 2431
x 1330

Re: version control for macro development

Unread post by bnemec »

The .NET suggestions, are you still doing macros or toss macros all together and do stand alones and add-ins?

Edit: Sorry, I just read the second link and see Jim's opinion on that clearly.
User avatar
Frederick_Law
Posts: 1815
Joined: Mon Mar 08, 2021 1:09 pm
Answers: 8
Location: Toronto
x 1525
x 1367

Re: version control for macro development

Unread post by Frederick_Law »

Manually copy to GIT with new release or Rev.
User avatar
JSculley
Posts: 574
Joined: Tue May 04, 2021 7:28 am
Answers: 52
x 7
x 806

Re: version control for macro development

Unread post by JSculley »

AlexB wrote: Thu Jan 25, 2024 9:00 am I've migrated all of my projects to c# using visual studio community for development and github for version control. Github is a game changer when compared to storage of copies on a network drive.
I opted for a self-hosted Gitlab installation.

Also, please be aware that VS Community has a pretty restrictive license. You have to be a very small enterprise to be legally allowed to use it in a commercial setting.

If you are getting really fancy, you can use the CI/CD features of Gitlab (and Github I suspect) to automatically package and publish add-ins and such every time you push a new tag on the main branch.
Ulf Stockburger
Posts: 4
Joined: Thu Mar 25, 2021 8:20 am
Answers: 0
Location: Germany
x 3
Contact:

Re: version control for macro development

Unread post by Ulf Stockburger »

You can create a git bare repository on your network and clone it to the local computer you are working on. You cannot work with *.swb files, but you can work with *.bas files. To avoid the disadvantage of working with *.bas files, the *.bas files can be postloaded into a *.swp file. Early Bindings can still be used as usual in the *.swp file. So there are no restrictions. I have been using this system for several years now and have not found any drawbacks to it.

https://github.com/erppdm/VBADC?tab=rea ... file#vbadc
User avatar
mp3-250
Posts: 535
Joined: Tue Sep 28, 2021 4:09 am
Answers: 18
Location: Japan
x 595
x 274

Re: version control for macro development

Unread post by mp3-250 »

I have not enough experience with both coding and git so I could be wrong, but it seems that versioning systems are messing with file encoding. while for most users here it has no impact, for us working with Japanese OS it could cause a mess.
All my batch files are made as shift jis encoded, I tried to add one to a test repository git and the diff tool in git desktop,(the first ui I found) show garbled text which means encoding problems.

With thise kind of issues just storing binaries, pdm like would be enough probably. is there a way to force git to see all files as binary or does anyone know another tool that could be used?
User avatar
JSculley
Posts: 574
Joined: Tue May 04, 2021 7:28 am
Answers: 52
x 7
x 806

Re: version control for macro development

Unread post by JSculley »

mp3-250 wrote: Sat Jan 27, 2024 2:08 pm All my batch files are made as shift jis encoded, I tried to add one to a test repository git and the diff tool in git desktop,(the first ui I found) show garbled text which means encoding problems.
Can you upload a sample file? I'd like to see how it behaves.

Also, you don't really need a program with a fancy UI to work with git. Just install git and use the Git bash application which is basically a git aware command prompt.
Post Reply