Version Control Support in FreeCAD

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
realthunder
Posts: 1344
Joined: Tue Jan 03, 2017 10:55 am

Version Control Support in FreeCAD

Postby realthunder » Mon Aug 05, 2019 5:57 am

I know that version control (e.g. git) support for FreeCAD document has been requested several times. I am also aware the Arch git utility mentioned in wiki page (but I couldn't find it in current release, is it removed?) Anyway, I hereby announcing my effort to bring proper support of version control (VC) to FreeCAD. In short, it is now possible to save and restore directly from uncompressed directory, and all files saved inside are completely text based and optimized for line based diff operation. For more details, please check out the big commit message here.

I didn't add any code to interact with the actual VC software. That being said, it is already pretty usable with an external VC, such as git, since it is easy to use git to find out what are the new files added. And unused files are auto deleted by FreeCAD, so git can show you the deleted files as well.

Many of you may know that my Link merge is on the way. This VC patch can be applied after the big merge. So I guess it can happen pretty soon. Part of the reason I am opening this topic is to inspire other interested developers to continue the development with the actual VC interaction. It should be modularized, preferably developed using Python, such that more than one VC can be supported. Interested developers can checkout my branch at here. For end users, please be warned that the file format hasn't been finalized yet, there may be breaking change along the way, although the archived format is kept same for backward compatibility.
Try Assembly3 (latest version 0.10.2) along 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
easyw-fc
Posts: 2773
Joined: Thu Jul 09, 2015 9:34 am

Re: Version Control Support in FreeCAD

Postby easyw-fc » Mon Aug 05, 2019 8:36 am

Hi @realthumder
Is there a chance to have also a visual version control like the following one?
3d-repo-open-source-revision-control-framework-for-large-3d-models
3drepo.com/publications
-
phpBB [video]

Maybe an approach mixing your and the 3D diff would cover many user cases.
In my user case, when I model an enclosure I would need to know what I have changed from a version to an other (i.e. size or position of holes, or height etc...)... a tool to visualize it would be great, beside a tool for VC.

In kicad there is something arising:
(but obviously kicad is a simpler task because is on a 2D environment)
-
https://github.com/Gasman2014/KiCad-Diff
phpBB [video]

phpBB [video]
realthunder
Posts: 1344
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Postby realthunder » Mon Aug 05, 2019 9:13 am

easyw-fc wrote:
Mon Aug 05, 2019 8:36 am
Hi @realthumder
Is there a chance to have also a visual version control like the following one?
Yes exactly! I was actually thinking about a shape diff task panel while developing this VC patch. And I have a rough idea of how to accomplish this. Just compare two shapes face by face, by exporting individual faces and then compare the texts. My topo naming will be handy when it comes to finding the correct pair of faces to compare. But of course there maybe other difficulties. Anyway, this is definitely on my to do list.
Try Assembly3 (latest version 0.10.2) along 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
easyw-fc
Posts: 2773
Joined: Thu Jul 09, 2015 9:34 am

Re: Version Control Support in FreeCAD

Postby easyw-fc » Mon Aug 05, 2019 11:39 am

realthunder wrote:
Mon Aug 05, 2019 9:13 am
Yes exactly! I was actually thinking about a shape diff task panel while developing this VC patch. And I have a rough idea of how to accomplish this. Just compare two shapes face by face, by exporting individual faces and then compare the texts. My topo naming will be handy when it comes to finding the correct pair of faces to compare. But of course there maybe other difficulties. Anyway, this is definitely on my to do list.
Great .. thx a lot!
User avatar
apeltauer
Posts: 238
Joined: Fri Aug 11, 2017 2:19 pm

Re: Version Control Support in FreeCAD

Postby apeltauer » Mon Aug 05, 2019 3:50 pm

:+1: looking forward for this...
User avatar
Kunda1
Posts: 6427
Joined: Thu Jan 05, 2017 9:03 pm

Re: Version Control Support in FreeCAD

Postby Kunda1 » Mon Aug 05, 2019 7:10 pm

@reox would love to hear this news
reox wrote:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
DeepSOIC
Posts: 7292
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Version Control Support in FreeCAD

Postby DeepSOIC » Mon Aug 05, 2019 11:25 pm

Wow, that's a good direction! I had plans for some hacks in part-o-magic for storing uncompressed FCStd files, but now that's getting irrelevant, as FC hopefully will soon support it internally thanks to you, nice!
foadsf
Posts: 88
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: Version Control Support in FreeCAD

Postby foadsf » Tue Aug 06, 2019 6:37 am

Great idea. It would also be great to have a PDM/PLM cloud platform for team collaboration. I had listed some of the Free, Libre and Open source options here. Imagine we could edit some components and they would be locked for other users and then everything would be merged automatically. Proper progress description...

The options are:
chrisb
Posts: 21384
Joined: Tue Mar 17, 2015 9:14 am

Re: Version Control Support in FreeCAD

Postby chrisb » Tue Aug 06, 2019 7:15 am

foadsf wrote:
Tue Aug 06, 2019 6:37 am
Besides git there seems subversion to be a widely used standard.
foadsf wrote:
Tue Aug 06, 2019 6:37 am
magine we could edit some components and they would be locked for other users and then everything would be merged automatically.
If locking is required then it may be necessary to split Document.xml in tiny pieces, e.g. with a file for every single object.
realthunder
Posts: 1344
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Postby realthunder » Tue Aug 06, 2019 7:18 am

chrisb wrote:
Tue Aug 06, 2019 7:15 am
If locking is required then it may be necessary to split Document.xml in tiny pieces, e.g. with a file for every single object.
That's exactly what I did. Check out my commit message. There are more options.
Try Assembly3 (latest version 0.10.2) along 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