diff options
author | Dante Catalfamo | 2021-04-12 12:37:41 -0400 |
---|---|---|
committer | Dante Catalfamo | 2021-04-12 12:37:54 -0400 |
commit | 0876454c89dd7a4d899bdc1bd7ba96ef85f5d2ab (patch) | |
tree | 4946168a3eb42b9d79544f8568225fd2ef865f64 | |
parent | 3a5ead0342a50b1e7d1c07530dc883de9bd9b8a6 (diff) | |
download | blog-0876454c89dd7a4d899bdc1bd7ba96ef85f5d2ab.tar.gz blog-0876454c89dd7a4d899bdc1bd7ba96ef85f5d2ab.tar.bz2 blog-0876454c89dd7a4d899bdc1bd7ba96ef85f5d2ab.zip |
freecad-git: make it nicer
-rw-r--r-- | content/posts/WIP-freecad-and-git/index.org | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/content/posts/WIP-freecad-and-git/index.org b/content/posts/WIP-freecad-and-git/index.org index 7847857..fb80c24 100644 --- a/content/posts/WIP-freecad-and-git/index.org +++ b/content/posts/WIP-freecad-and-git/index.org @@ -8,7 +8,8 @@ #+SUMMARY: I've been working a lot with [[https://freecadweb.org/][FreeCAD]] recently since I got my 3D -printer, and have run into some issues. +printer. It's been a mostly excellent experience, but I've run into my +fair share issues. Between the MacOS version and Linux version of FreeCAD (both 0.19, maybe different builds?), a project that I've been working on for a @@ -18,32 +19,31 @@ edit the sketches, rendering it useless. This has led me on a quest to find out how I can manage these files through version control like =git=. -It would seem that FreeCAD saves are nothing more than zip files +It would seem that FreeCAD files are nothing more than zip files containing text documents, which should make this rather easy. Unfortunately there isn't a standard process to git control a zipped folder, though I have come across a couple methods which when used together, result in an adequate solution. -The main component of this workaround is a great little script -called [[https://bitbucket.org/sippey/zippey/src/master/][zippey]], which allows git to handle and diff zip files in a -way that makes storing them much more efficient. +The main component of this workaround is a great little script called +[[https://bitbucket.org/sippey/zippey/src/master/][zippey]], which allows git to efficiently store zip files using +something called a [[https://git-scm.com/docs/gitattributes#_filter][filter attribute]]. The second isn't as much a tool as it is a snippet from a [[https://tante.cc/2010/06/23/managing-zip-based-file-formats-in-git/][blog post]] -about diffing zip files with git. By combining both these methods -we can arrive at a pretty good method of handling FreeCAD save -data. +about diffing zip files using a [[https://git-scm.com/docs/gitattributes#_diff][different]] attribute. By combining both +these methods we can arrive at a pretty good method of handling +FreeCAD save data. The first step is to download the zippy python program. Since I keep all source repositories under =~/src= in directories based on the website and user who created them, I'll be cloning it to =~/src/bitbucket.org/sippey/zippey=. -Then I configure my =~/.gitconfig= to so that the =diff= and -=filter= settings are how I want them. - -I'll also setup a global git [[https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes][attributes]] file so that I don't need -to set the association with =.FCStd= files in each repo individually. +Then I configure my =~/.gitconfig= to so that the =diff= and =filter= +settings are used globally. I'll also setup a global git [[https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes][attributes]] +file so that I don't need to set the association with =.FCStd= files +in each repo individually. I add the following lines to my =~/.gitconfig=. @@ -64,12 +64,9 @@ Then I create a =~/.gitattributes= file with the following content. ,*.FCStd diff=zip #+end_src -With this =git= should be now be able to effectively diff and store +With this, =git= should be now be able to effectively diff and store proper deltas when FreeCAD files are modified. Keep in mind you need to redo this process on each computer you plan on using this with, otherwise the files git produces won't make any sense. - -Also despite having diffs, these files cannot be merged or rebased, -the use of diffs is just do that =git= can store the file more efficiently. |