kynan / nbstripout

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

--install --global must be run in a git repository #123

Closed puddyput closed 4 years ago

puddyput commented 4 years ago
$ nbstripout --install --global
fatal: not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Installation failed: not a git repository!

I'm surprised by this behaviour, shouldn't this be independent of a git repo?

puddyput commented 4 years ago

The workaround is basically described in the README

git config --global filter.nbstripout.clean $(which nbstripout)
git config --global filter.nbstripout.smudge cat
git config --global filter.nbstripout.required true
git config --global diff.ipynb.textconv "$(which nbstripout) -t"
kynan commented 4 years ago

There were a few reasons why also the --global variant of --install needed to be run from within a git repo (as did the --global variants of --status and --uninstall). That's now fixed.