Skip to content

Conversation

jniedzie
Copy link

@jniedzie jniedzie commented Oct 4, 2024

Hi @maksymovchynnikov,

I'm creating this PR following our discussion some time ago about tracking changes in Mathematica code. As mentioned, we figured that it's much easier if one uses .wls files instead of .nb. In this PR, I simply saved the most important notebooks in .wls format and stored them in the wls and codes/wls directories. There are no real changes to your code here.

For an even more convenient changes comparison, I also included a small script prepare_wls_files.sh, which simply makes sure that all .wls files in the repo have Chapters and Titles closed, as otherwise just opening/closing them appears as a change in the code.

To summarize, if you agree with this approach, one would have to follow this workflow:

  • work on .nb files as usual (and save them as usual)
  • Only before committing: "SaveAs..." the notebook, selecting .wls format (and agreeing to convert all cells, also not code ones) and save it to the corresponding wls directory
  • run ./prepare_wls_files.sh
  • commit both .ns and .wls files to the repo.

Then, when reviewing changes, one can ignore those in .nb files (which are impossible to track) and only look at .wls, knowing that what's in the .nb is identical.

Unfortunately, this is not a perfect solution - if more than one person modifies a notebook, the changes can be merged easily in the corresponding .wls, but probably would have to be included manually in the notebook. However, at least such changes/conflicts will be clearly visible when comparing .wls files.

Best,
Jeremi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant