Skip to content

[windows] some hooks are tried to be executed even if there is no such a file #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
KOLANICH opened this issue Jun 9, 2018 · 5 comments

Comments

@KOLANICH
Copy link

KOLANICH commented Jun 9, 2018

For example

run_commit_hook('pre-commit', self)

May be the cause of 703

@Byron Byron added the rejected label Jun 10, 2018
@Byron
Copy link
Member

Byron commented Jun 10, 2018

This is not true - it checks for accessibility inside that function.

Even though this ticket is closed, please feel free to state the underlying problem so people can chime in and help.

@Byron Byron closed this as completed Jun 10, 2018
@KOLANICH
Copy link
Author

KOLANICH commented Jun 12, 2018

This is not true - it checks for accessibility inside that function.

That's strange. Windows 7, 32-bit. On popen it fails with a window appearing saying that the hook file is not a win32 application. In fact there was no such a file at all in the hooks dir.

@Byron
Copy link
Member

Byron commented Jul 15, 2018

It is strange indeed. If you can provide a simple python script that reproduces the issue, it truly is a bug worth fixing. Might just be very special behaviour on a OS whose tests are known to be broken for GitPython.

@EricMoorman
Copy link

If anyone is still following this, I had a similar error to this, but with run_commit_hook('post-commit', self) instead of pre-commit. What I have done to fix the error is to convert the post-commit file in .git folder to a .bat file. The error of the system complaining that the file is not a Win32 application comes from the fact that Windows doesn't like executing files. This resolution seems a little hacky to me, so if anyone has a better solution that would be great.

@Byron Byron reopened this Dec 22, 2018
@Byron Byron changed the title some hooks are tried to be executed even if there is no such a file [windows] some hooks are tried to be executed even if there is no such a file Dec 22, 2018
@Byron
Copy link
Member

Byron commented Dec 22, 2018

I have reopened the issue on account of this seemingly happening on windows, which by now is an entirely untested platform, unfortunately.

Until there is a fix, one might try to use the skip_hooks=true flag when executing IndexFile.commit(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants