pre-commit: "Not a git repository" error in Cygwin

pre-commit install seems to have worked fine, but when executing pre-commit run I run into the following problem:

$ pre-commit run
[INFO] Initializing environment for git://github.com/pre-commit/pre-commit-hooks.
An unexpected error has occurred: CalledProcessError: Command: ['git', 'reset', 'v0.4.2', '--hard']
Return code: 128
Expected return code: 0
Output: (none)
Errors:
    fatal: Not a git repository (or any of the parent directories): .git


Check the log at ~/.pre-commit/pre-commit.log

This is a Windows machine, inside a Cygwin shell, with 1.9.4.msysgit.2 and Python 2.7.10.

Obviously this is working just fine on my colleagues’ computers who are on Macs 😢

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Sounds great! Glad to help 😃

I’ve opened #354 to at least make this error case more obvious – I’ll see if I can’t make it easy to “just work” in these cases, barring that I’ll at least add an error message in the short term.

Thanks again for the great bug report and useful debugging information!