MindTheGap-ERC / CarboKitten.jl

Julia implementation of carbonate platform model
https://mindthegap-erc.github.io/CarboKitten.jl/
GNU General Public License v3.0
0 stars 0 forks source link

Switching branches cumbersome after running code #34

Closed HannoSpreeuw closed 1 month ago

HannoSpreeuw commented 3 months ago

I am on the main branch and I ran some code without modifying.

If I now want to switch to another branch, in my case xy-test, using git switch xy_test, I get

error: Your local changes to the following files would be overwritten by checkout:
    .entangled/filedb.json
    docs/src/fig/b13-capsosc-crosssection.png
    docs/src/fig/b13-crosssection.png
Please commit your changes or stash them before you switch branches.
Aborting

I am not sure about the json file, but why are the png files git tracked? They have apparently been reproduced by my run.

Perhaps untrack these pictures? And possibly also the json file?

Obviously git stash will do the job, but it is not ideal.

jhidding commented 3 months ago

After discussion at lunch table: we're generating figures locally and have them in version control, because they would take some time to render on the Github servers. It is advised to run examples from a Pluto notebook to get a more interactive experience.

Proposed fix for this immediate issue: create the figures in a different folder and only copy them to the version controlled place just before building the documentation.

HannoSpreeuw commented 2 months ago

Solution by @EmiliaJarochowska : Add all pngs to .gitignore and add exceptions for the git tracked figures.

HannoSpreeuw commented 1 month ago

@EmiliaJarochowska In hindsight, I am not sure that would work since the problems come from git tracked figures being regenerated.

HannoSpreeuw commented 1 month ago

Also, I currently cannot reproduce this issue.

From main I ran poetry run brei figures to regenerate figures and git switch -c my-beautiful-new-branch to see if the problem persists, but it does not, afaik.

Will close this issue before the end of this week unless anyone encounters a similar problem.

jhidding commented 1 month ago

Figures will only rebuild if you change some of their direct dependencies. I think this is still an issue.

HannoSpreeuw commented 1 month ago

All right, apologies, I should have formulated this issue more accurately: git switch my-superduper-feature-branch may not reproduce this issue, but git switch xy_test will.

I am contemplating whether this issue is specific to the xy_test branch in any manner.....

HannoSpreeuw commented 1 month ago

Proposed solution from @jhidding: