Version Control Support in FreeCAD

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Post by realthunder »

Just saw the new discussions here. But it seems not many people bother to read through the posts, huh? What I have already done is to allow FreeCAD to save its document into a directory, without compression. The user can easily choose various layout of the directory. The one that is most suitable for version control in my opinion is to save each object into its own XML file, and save its BRep shape into separate file, all of which are doable in my branch. To see meaning diffs, simply ignore the BRep file diff. On the other extreme, the user can choose to save everything into two XML (Document.xml and GuiDocument.xml), for whatever reason. The actual 'Version Control' part can be implemented outside of FreeCAD.

BTW, I have also introduced APIs in my topo naming PR to compare shapes, that'll be the basis of a meanful diff tool for Brep shapes.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
sww1235
Posts: 32
Joined: Thu Mar 21, 2019 5:12 pm

Re: Version Control Support in FreeCAD

Post by sww1235 »

I think I saw you mention you added in the ability to save unzipped files, and I was just adding my support behind that effort.

Thanks
User avatar
tomsaw
Posts: 8
Joined: Mon Jun 03, 2019 7:22 am
Location: Essen Germany
Contact:

Re: Version Control Support in FreeCAD

Post by tomsaw »

According to https://github.com/realthunder/FreeCAD/ ... c933b2de1c the defaults for the file layout (Force XML, Prefere Binary, Split XML) can be adjusted in parameter editor path BaseApp/Preferences/Document.

But i can't find these parameters in there. Also searching for 'xml' in the exported parameters doesn't yield results.

How can these defaults be adjusted then?
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Post by realthunder »

tomsaw wrote: Mon Nov 07, 2022 9:17 am According to https://github.com/realthunder/FreeCAD/ ... c933b2de1c the defaults for the file layout (Force XML, Prefere Binary, Split XML) can be adjusted in parameter editor path BaseApp/Preferences/Document.

But i can't find these parameters in there. Also searching for 'xml' in the exported parameters doesn't yield results.

How can these defaults be adjusted then?
You can create those parameters by yourself. Right click in parameter editor, and select bool type for 'SplitXML' and 'PreferBinary', and int type for 'ForceXML'.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
tomsaw
Posts: 8
Joined: Mon Jun 03, 2019 7:22 am
Location: Essen Germany
Contact:

Re: Version Control Support in FreeCAD

Post by tomsaw »

realthunder wrote: Mon Nov 07, 2022 9:27 am
tomsaw wrote: Mon Nov 07, 2022 9:17 am According to https://github.com/realthunder/FreeCAD/ ... c933b2de1c the defaults for the file layout (Force XML, Prefere Binary, Split XML) can be adjusted in parameter editor path BaseApp/Preferences/Document.

But i can't find these parameters in there. Also searching for 'xml' in the exported parameters doesn't yield results.

How can these defaults be adjusted then?
You can create those parameters by yourself. Right click in parameter editor, and select bool type for 'SplitXML' and 'PreferBinary', and int type for 'ForceXML'.
Thanks realthunder, and Interesting: I would expect any ever possible parameter predeclared in there. Think like that's the standard, known f.e. from firefox -> about:config
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Version Control Support in FreeCAD

Post by adrianinsaval »

FreeCAD parameter editor is more comparable to the windows registry. I know, that's a terrible model to follow.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Version Control Support in FreeCAD

Post by GeneFC »

adrianinsaval wrote: Mon Nov 07, 2022 1:52 pm FreeCAD parameter editor is more comparable to the windows registry. I know, that's a terrible model to follow.
At least there are no GUIDs destroying all readability. :lol:

(I often add parameters to the Windows registry. They are not all preloaded.)

In the case of Firefox the extra (hidden) parameters are simply built into the code. In the case of FreeCAD all the adjustable parameters are contained in the user configuration files. Adding every possible predeclared option could greatly increase the size of those files. It could also make navigating and editing the parameters more difficult.

[Edit] I have added parameters to Firefox as well. They are not all pre-declared.

Gene
User avatar
tomsaw
Posts: 8
Joined: Mon Jun 03, 2019 7:22 am
Location: Essen Germany
Contact:

Re: Version Control Support in FreeCAD

Post by tomsaw »

All right then, i'm not familiar with the registry philosophy (using fedora) ;P but can adapt to it.

What's a generic way to find (all) parameter candidates? Throwing some regex onto the sourcecode :? ?
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Version Control Support in FreeCAD

Post by M4x »

There's a wiki page but I can't find it right now... :roll:
mmu_man
Posts: 1
Joined: Sat Feb 04, 2023 9:56 pm
Contact:

Re: Version Control Support in FreeCAD

Post by mmu_man »

Hi there, I started by commenting out on the existing issue until I found this forum thread… thanks for working on it, I'd welcome this as well, being used to OpenSCAD + git.

For now I'll disable compression in the GUI and hope this gets merged before I have anything to publish, so I can filter-branch before doing so.
Post Reply