kynan / nbstripout

strip output from Jupyter and IPython notebooks
Other
1.19k stars 95 forks source link

git-hook applies nb-stripout on unstaged notebooks #137

Closed krlng closed 1 year ago

krlng commented 3 years ago

Using nb-stripout (v 0.3.8) as a git-hook will strip-out content of unstaged, not committed notebooks as soon as there is at least one notebook which gets committed. In my opinion, files which are not staged should not get touched or this should be documented otherwise.

kynan commented 3 years ago

Can you confirm what your setup is? Are you using the pre-commit framework with a .pre-commit-config.yaml as documented in the README? A reproducible test case would also be super useful.

Note that the pre-commit framework stashes unstaged changes while the hook is running.

kynan commented 3 years ago

I think this is similar to #121. See my comment with the log of a test which produced the exact result I expected, using pre-commit 2.12.0.

kynan commented 1 year ago

@krlng is this still an issue for you?

krlng commented 1 year ago

Hi :) I have no idea, not using it anymore. Will close it.