wrt, executable scripts losing their exec bit on checkout I found this - see if it helps for preserving script’s executability on checkout. And this maybe.
And if either of these fixes the problem, please report what worked step by step, so that we could add it to the documentation.
wrt, trace, sorry I should have written please test git commit -a
, or git add
and then git commit
- you showed the output the other way around where it won’t have run the filters anyway.
Though since git diff
with trace didn’t show anything, it seems that somehow git ignores the configuration. e.g. on linux I get:
GIT_TRACE=1 git diff dev_nb/001a_nn_basics.ipynb
09:08:08.628998 git.c:344 trace: built-in: git diff dev_nb/001a_nn_basics.ipynb
09:08:08.629335 run-command.c:640 trace: run_command: unset GIT_PAGER_IN_USE; LESS=FRX LV=-c pager
09:08:08.629937 run-command.c:640 trace: run_command: tools/fastai-nbstripout
09:08:08.679979 run-command.c:640 trace: run_command: tools/fastai-nbstripout
09:08:08.727291 run-command.c:640 trace: run_command: cat
09:08:08.728347 run-command.c:640 trace: run_command: 'tools/fastai-nbstripout -t' /tmp/wZWBY0_001a_nn_basics.ipynb
09:08:08.779598 run-command.c:640 trace: run_command: 'tools/fastai-nbstripout -t' dev_nb/001a_nn_basics.ipynb
diff --git a/dev_nb/001a_nn_basics.ipynb b/dev_nb/001a_nn_basics.ipynb
index e170ba0..2de019e 100644
--- a/dev_nb/001a_nn_basics.ipynb
+++ b/dev_nb/001a_nn_basics.ipynb
@@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "# A basic training loop"
+ "# A basic training loop "
]
},
{
I don’t have a windows setup so the following are just ideas. Let’s try to experiment with various settings in .gitconfig
, e.g.:
Rename to add .py to the script and change to:
[filter "fastai-nbstripout-code"]
clean = tools/fastai-nbstripout.py
smudge = cat
required = true
[diff "ipynb-code"]
textconv = tools/fastai-nbstripout.py -t
then, if it’s not working, try:
clean = python.exe tools/fastai-nbstripout.py
adjust to wherever your python.exe is if need be.
and finally a variation on a debug filter, which will use git’s internal shell:
clean = "f() { tools/fastai-nbstripout.py; }; f %f"
all these experiments are to be tested with git commit -a
once you edited a code notebook, and best to keep GIT_TRACE=1 set.
Also have you tried gitforwindows.org? (install) - it suggests that it has a bash emulation. Or perhaps this is what you use already.