gitui: pre-commit hooks do not run

I have been usuing gitui quite regularly for a few weeks and I am in love with it. The only downside is that pre-commit hooks are not running and sometimes I don’t see errors until they hit CI.

Describe the bug pre-commit hooks do not run.

To Reproduce Create a commit in a repo with pre-commit hooks installed.

Try with a sample pre-commit.

pip instal pre-commit
pre-commit sample-config > .pre-commit-config.yaml
pre-commit install

Expected behavior pre-commit hooks run after the message is entered.

Screenshots If applicable, add screenshots to help explain your problem.

Context (please complete the following information):

  • wsl/Debian 9
  • docker/stretch
  • GitUI Version: 0.10.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (22 by maintainers)

Commits related to this issue

Most upvoted comments

I can take this one if you like

OK the subtle difference is that #! is interpreted by the kernel exec loader , its not done by the shell. In gitui you do ‘bash ‘file’’ this says to bash ‘run these commands’, the #! is just a comment

in your test you say bash -c ‘file’ which says run this command, its not a builtin so its passed to the exec loader, that reads the #! and runs /bin/env python

i see and it works for me too, but the python from pre-commit fails as I showed. I will find out why. I changed gitui run code to what I think it should be and it works with the pre-commit scripts, but I want to understand the difference

And I think windows will be a different story too.

NOTE- in your test you do ‘sh’, in gitui you do ‘bash’ - but its not the cause of the difference

as far as can see there is no code to run pre-commit checks in gitui. Only commit-msg and post-commit