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!
Post Reply
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Version Control Support in FreeCAD

Post by realthunder »

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 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
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Version Control Support in FreeCAD

Post by easyw-fc »

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
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Post by realthunder »

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 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
Veteran
Posts: 3629
Joined: Thu Jul 09, 2015 9:34 am

Re: Version Control Support in FreeCAD

Post by easyw-fc »

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: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Version Control Support in FreeCAD

Post by apeltauer »

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

Re: Version Control Support in FreeCAD

Post by Kunda1 »

@reox would love to hear this news
reox wrote:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Version Control Support in FreeCAD

Post by DeepSOIC »

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: 102
Joined: Fri Mar 06, 2015 10:02 pm
Contact:

Re: Version Control Support in FreeCAD

Post by foadsf »

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
Veteran
Posts: 53926
Joined: Tue Mar 17, 2015 9:14 am

Re: Version Control Support in FreeCAD

Post by chrisb »

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.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Version Control Support in FreeCAD

Post by realthunder »

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 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
Post Reply