Storing FreeCAD files in a git repo

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Storing FreeCAD files in a git repo

Post by reox »

microartisan wrote: Wed Apr 25, 2018 4:23 pm checked you code in github.
It looks you don't unzip the freecad file?
right?
Kunda1 wrote: Wed Apr 25, 2018 3:55 pm WIP https://github.com/reox/FreeCAD_gitproject
reox wrote:poke
nope, they are not unpacked.
The problem with unpacking is, that you can not simply send the file to someone else etc... My approach was to have as less special setup as possible.
So you should be able to run FreeCAD without the plugin to open the files from the repo and you should be able to move the files from the repo without having to do anything.
User avatar
hardeeprai
Posts: 177
Joined: Sun May 23, 2010 2:41 pm
Location: Ludhiana, Punjab, India
Contact:

Re: Storing FreeCAD files in a git repo

Post by hardeeprai »

microartisan wrote: Fri Mar 23, 2018 11:56 am https://bitbucket.org/sippey/zippey

I try this python tool, it work well for me to use git.

Zippey: A Git filter for friendly handling of ZIP-based files
A similar tool

https://github.com/costerwi/rezip

I believe the present "git" is part of WebTools workbench in FreeCAD, and it does not push unzipped files. Is it possible to add such filter automatically, when using git from within FreeCAD with FreeCAD files, on Installing WebTools?
--
H.S.Rai
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Storing FreeCAD files in a git repo

Post by reox »

hardeeprai wrote: Sun Feb 24, 2019 9:56 am
microartisan wrote: Fri Mar 23, 2018 11:56 am https://bitbucket.org/sippey/zippey

I try this python tool, it work well for me to use git.

Zippey: A Git filter for friendly handling of ZIP-based files
A similar tool

https://github.com/costerwi/rezip

I believe the present "git" is part of WebTools workbench in FreeCAD, and it does not push unzipped files. Is it possible to add such filter automatically, when using git from within FreeCAD with FreeCAD files, on Installing WebTools?
you would need to rewrite the git config... you can also define this globally per file ending.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Storing FreeCAD files in a git repo

Post by yorik »

hardeeprai wrote: Sun Feb 24, 2019 9:56 am A similar tool
https://github.com/costerwi/rezip
Interesting, thanks! The other one has better doc but this one is simpler...
hardeeprai wrote: Sun Feb 24, 2019 9:56 am I believe the present "git" is part of WebTools workbench in FreeCAD, and it does not push unzipped files. Is it possible to add such filter automatically, when using git from within FreeCAD with FreeCAD files, on Installing WebTools?
I hadn't thought about it, but that could be an interesting idea. I don't know how much it is possible to automate the filter configuration, though. To be tested..
bricechart
Posts: 26
Joined: Mon Jun 02, 2014 6:45 pm

Re: Storing FreeCAD files in a git repo

Post by bricechart »

What happens when you disable compression within FreeCAD. Does GIT then handle the files properly?
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Storing FreeCAD files in a git repo

Post by chrisb »

Even if you set the compression level to 0 it remains a zip container.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
bricechart
Posts: 26
Joined: Mon Jun 02, 2014 6:45 pm

Re: Storing FreeCAD files in a git repo

Post by bricechart »

chrisb wrote: Fri Aug 09, 2019 5:21 am Even if you set the compression level to 0 it remains a zip container.
I'm not 100% familiar how ZIP file structure works. Why is is that with 0 compression the file is viewable in Notepad++
FreeCAD Noptepad++.png
FreeCAD Noptepad++.png (79.05 KiB) Viewed 2197 times
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Storing FreeCAD files in a git repo

Post by reox »

if you choose STORE as compression, it will just put the file as is after the local file header.
You can see the start of the first local file header in the editor: PK
bricechart
Posts: 26
Joined: Mon Jun 02, 2014 6:45 pm

Re: Storing FreeCAD files in a git repo

Post by bricechart »

reox wrote: Fri Aug 09, 2019 9:04 am if you choose STORE as compression, it will just put the file as is after the local file header.
You can see the start of the first local file header in the editor: PK
But doesn't GIT recognize the information after the header? When I perform commits with large FreeCAD files (300+MB), it doesn't appear to be uploading the entire file.
reox
Posts: 929
Joined: Sat Aug 13, 2016 10:06 am
Contact:

Re: Storing FreeCAD files in a git repo

Post by reox »

bricechart wrote: Fri Aug 09, 2019 6:41 pm
reox wrote: Fri Aug 09, 2019 9:04 am if you choose STORE as compression, it will just put the file as is after the local file header.
You can see the start of the first local file header in the editor: PK
But doesn't GIT recognize the information after the header? When I perform commits with large FreeCAD files (300+MB), it doesn't appear to be uploading the entire file.
what do you mean by "recognize"? git does not recognize anything in files, but simply stores them as an object.
using git with large files is also not ideal, there are tools for such use cases like git annex.
but in any case, partial file uploads (do you mean git push?) should not happen.
Post Reply