nbstripout icon indicating copy to clipboard operation
nbstripout copied to clipboard

git-hook applies nb-stripout on unstaged notebooks

Open krlng opened this issue 3 years ago • 2 comments

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.

krlng avatar Sep 23 '20 07:09 krlng

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 avatar Apr 11 '21 22:04 kynan

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 avatar Apr 11 '21 23:04 kynan

@krlng is this still an issue for you?

kynan avatar Sep 24 '22 12:09 kynan

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

krlng avatar Oct 05 '22 06:10 krlng