automatic commits may fail if pre-commit hooks are installed.
I have a repo with output-stripping pre-commit hooks, and it means that if I ever visit an nbgitpuller link with an unclean state, pull fails.
In typical pre-commit fashion, often running the commit a second time succeeds, but may not always.
$ git -c user.email=nbgitpuller@nbgitpuller.link -c user.name=nbgitpuller commit -am Automatic commit by nbgitpuller --allow-empty
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check json...............................................................Passed
check yaml...........................................(no files to check)Skipped
mdformat.............................................(no files to check)Skipped
nbqa-ruff................................................................Passed
nbstripout...............................................................Failed
- hook id: nbstripout
- files were modified by this hook
Traceback (most recent call last):
File "/opt/conda/lib/python3.12/threading.py", line 1075, in _bootstrap_inner
self.run()
File "/opt/conda/lib/python3.12/threading.py", line 1012, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/handlers.py", line 99, in pull
raise e
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/handlers.py", line 93, in pull
for line in gp.pull():
^^^^^^^^^
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/pull.py", line 144, in pull
yield from self.update()
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/pull.py", line 340, in update
yield from self.commit_all()
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/pull.py", line 299, in commit_all
yield from execute_cmd([
File "/opt/conda/lib/python3.12/site-packages/nbgitpuller/pull.py", line 48, in execute_cmd
raise subprocess.CalledProcessError(ret, cmd)
subprocess.CalledProcessError: Command '['git', '-c', 'user.email=nbgitpuller@nbgitpuller.link', '-c', 'user.name=nbgitpuller', 'commit', '-am', 'Automatic commit by nbgitpuller', '--allow-empty']' returned non-zero exit status 1.
Bug description
automatic commits may fail if pre-commit hooks are installed.
I have a repo with output-stripping pre-commit hooks, and it means that if I ever visit an nbgitpuller link with an unclean state, pull fails.
In typical pre-commit fashion, often running the commit a second time succeeds, but may not always.
Options:
How to reproduce
Expected behaviour
Pull succeeds
Actual behaviour
Pull fails with an error:
Your personal set up
Full environment