Open grzegorz700 opened 1 day ago
When we use this extension with git-based sytems it produces 10(5*2) lines of diffs per every changed cell.
"metadata": { "execution": { - "iopub.execute_input": "2024-10-14T13:10:30.905308Z", - "iopub.status.busy": "2024-10-14T13:10:30.904740Z", - "iopub.status.idle": "2024-10-14T13:10:30.908169Z", - "shell.execute_reply": "2024-10-14T13:10:30.907722Z", - "shell.execute_reply.started": "2024-10-14T13:10:30.905290Z" + "iopub.execute_input": "2024-10-14T19:16:26.414571Z", + "iopub.status.busy": "2024-10-14T19:16:26.413960Z", + "iopub.status.idle": "2024-10-14T19:16:26.417570Z", + "shell.execute_reply": "2024-10-14T19:16:26.417137Z", + "shell.execute_reply.started": "2024-10-14T19:16:26.414551Z" } },
This problem is well known without any perfect solution. Based on the many reference solutions, including the list from stackoverflow and a good advice https://github.com/jupyterlab/jupyterlab/issues/9444#issuecomment-743992307 and other stackoverflow solutions. I propose my partial workaround setup.
We could use this extension without massive diffs is based on two stages:
.gitattributes
touch .gitattributes
*.ipynb filter=clean_meta_ipynb
git config filter.clean_meta_ipynb.clean "jupyter nbconvert --to notebook --stdin --stdout --ClearMetadataPreprocessor.enabled=True"
nbdime_config.json
jupyter --paths
~/.jupyter/nbdime_config.json
{ "NbDiff": { "Ignore": { "/metadata": true, "/cells/*/metadata": true } }, "Extension": { "Ignore": { "/metadata": true, "/cells/*/metadata": true } } }
or we could try with the more precise exclusion like: "/cells/*/metadata":['execution'].
"/cells/*/metadata":['execution']
I put it that solution, especially for people who want to use this extension without the need to remove other info from notebooks (e.g. outputs).
However, I would love to see a better solution.
This question is maybe better focused outside this plugin, but have you tried https://github.com/deshaw/nbstripout-fast? With this, nbdime does not show timestamps diff nor commit them.
When we use this extension with git-based sytems it produces 10(5*2) lines of diffs per every changed cell.
This problem is well known without any perfect solution. Based on the many reference solutions, including the list from stackoverflow and a good advice https://github.com/jupyterlab/jupyterlab/issues/9444#issuecomment-743992307 and other stackoverflow solutions. I propose my partial workaround setup.
Partial workaround:
We could use this extension without massive diffs is based on two stages:
Prevent from pushing to git.
.gitattributes
file in the root of your repository:.gitattributes
file:Prevent from displaying diffs in jupyterlab-git:
nbdime_config.json
):nbdime_config.json
(e.g.~/.jupyter/nbdime_config.json
)or we could try with the more precise exclusion like:
"/cells/*/metadata":['execution']
.Drawbacks:
I put it that solution, especially for people who want to use this extension without the need to remove other info from notebooks (e.g. outputs).
However, I would love to see a better solution.