Difference between revisions of "Charon"

From CUSF Wiki
Jump to navigation Jump to search
("More detailed Charon docs")
m
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:


Charon is an integration between [[Git]] and SolidWorks, designed by
Charon is an integration between [[Git]] and SolidWorks, designed by
[[HenryFranks|Henry Franks]] and [[TimClifford|Tim Clifford]] to eliminate the
[[User:HenryFranks|Henry Franks]] and [[User:EllieClifford|Ellie Clifford]]
re-occuring problem of having \>10 versions of a CAD assembly on the Google
eliminate the re-occuring problem of having >10 versions of a CAD assembly on
Drive (with only one person understanding it).
the Google Drive (with only one person understanding it). It is named after the
ferryman to Hell (for obvious reasons).


The GitHub repository can be found [https://github.com/smh-my-head here]. It is
The GitHub repository can be found [https://github.com/smh-my-head/charon here].
developed by Tim and Henry seperately from CUSF (and thus not under the
You are welcome to contribute.
cuspaceflight organisation) but you are welcome to contribute.


It is assumed that you understand [[Git]], please read that page first. Charon
It is assumed in this page that you understand [[Git and GitHub]], please read
aims to keep the overall workflow as similar as possible to using Git for code,
that page first. Charon aims to keep the overall workflow as similar as
with two important differences:
possible to using Git for code, but with a new merge and diff driver to enable
working with SolidWorks' binary file formats.


= Features and Usage =
= Features and Usage =
[[File:Charon hades example.png|thumb|800px|A graphical difference shown by Charon (running
on [[Hades]])]]


== Enhanced diffs ==
== Enhanced diffs ==
Line 20: Line 24:
Without Charon, all <code>git diff</code> can tell you is that two files are
Without Charon, all <code>git diff</code> can tell you is that two files are
different. With charon enabled, <code>git diff</code> will open SolidWorks to
different. With charon enabled, <code>git diff</code> will open SolidWorks to
show you an interactive, graphical diff between the files, like this:
show you an interactive, graphical diff between the files, as shown in the screenshot.


TODO: example image
Note that due to technical limitations caused by Solidworks, Charon cannot
leave SolidWorks in this state, you will need to open the compare tool manually
(under ''Tools -> Compare'')


== Usable mergetool ==
== Usable mergetool ==
''This output is not stable at the moment, it could change''


Charon makes merging branches actually possible (but it will never be that
Charon makes merging branches actually possible (but it will never be that
easy...). A merge conflict will be presented in the same way:
easy...). A merge conflict will result in something like the following:


<source>
<source>
TODO: Example conflict
Disconnect_Puller.SLDPRT conflicts. Choose one of the following options:
<source>
  local:  take the local  file (what you are merging into)
 
  remote: take the remote file (what you are merging)
But on running <code>git mergetool</code>, you will be presented with a menu
  edit:   open the files in SolidWorks to edit manually
like this:
  abort:  abort the merge resolution
 
Enter your choice:
<source>
TODO: Example mergetool menu
</source>
</source>


The options are fairly self explanatory.
Most of the options are fairly self explanatory, the interesting one is
 
<code>edit</code>. It will open the files in exactly the same way as
TODO: another screenshot
[[Hades#Enhanced diffs|the diff tool]], and you can view and/or edit them.
After you exit solidworks, you will be returned to the menu. (Your edits to the
files will be saved). You can then choose a file to take.


= Installation =
= Installation =
Line 53: Line 61:
<source lang="bash">
<source lang="bash">
git submodule add https://github.com/smh-my-head/charon
git submodule add https://github.com/smh-my-head/charon
git submodule update --init
./charon/setup.sh
./charon/setup.sh
</source>
</source>
Line 59: Line 66:
== Cloning a repository that uses Charon ==
== Cloning a repository that uses Charon ==


When cloning a repository that uses Charon, you will need to need to run the
When cloning a repository that uses Charon, you will also need to need to run
setup script. Something like:
the setup script. Something like:


<source lang="bash">
<source lang="bash">

Latest revision as of 21:19, 25 April 2024

This page is unfinished

Charon is an integration between Git and SolidWorks, designed by Henry Franks and Ellie Clifford eliminate the re-occuring problem of having >10 versions of a CAD assembly on the Google Drive (with only one person understanding it). It is named after the ferryman to Hell (for obvious reasons).

The GitHub repository can be found here. You are welcome to contribute.

It is assumed in this page that you understand Git and GitHub, please read that page first. Charon aims to keep the overall workflow as similar as possible to using Git for code, but with a new merge and diff driver to enable working with SolidWorks' binary file formats.

Features and Usage

A graphical difference shown by Charon (running on Hades)

Enhanced diffs

Without Charon, all git diff can tell you is that two files are different. With charon enabled, git diff will open SolidWorks to show you an interactive, graphical diff between the files, as shown in the screenshot.

Note that due to technical limitations caused by Solidworks, Charon cannot leave SolidWorks in this state, you will need to open the compare tool manually (under Tools -> Compare)

Usable mergetool

This output is not stable at the moment, it could change

Charon makes merging branches actually possible (but it will never be that easy...). A merge conflict will result in something like the following:

Disconnect_Puller.SLDPRT conflicts. Choose one of the following options:
  local:  take the local  file (what you are merging into)
  remote: take the remote file (what you are merging)
  edit:   open the files in SolidWorks to edit manually
  abort:  abort the merge resolution
Enter your choice:

Most of the options are fairly self explanatory, the interesting one is edit. It will open the files in exactly the same way as the diff tool, and you can view and/or edit them. After you exit solidworks, you will be returned to the menu. (Your edits to the files will be saved). You can then choose a file to take.

Installation

Enabling Charon in a repository

To enable Charon in an existing repository, add it as a submodule and run the setup script:

git submodule add https://github.com/smh-my-head/charon
./charon/setup.sh

Cloning a repository that uses Charon

When cloning a repository that uses Charon, you will also need to need to run the setup script. Something like:

git clone https://github.com/cuspaceflight/repository-that-uses-charon
cd repository-that-uses-charon
git submodule update --init
./charon/setup.sh

Updating Charon

You may want to update Charon if improvements are made. To do this, update the submodule and then run the setup script again (each user will need to run the setup script):

git submodule update --remote
./charon/setup.sh