Skip to content
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

Check Git core.fileMode rather than infer from OS. #730

Merged
merged 1 commit into from
May 26, 2022
Merged

Check Git core.fileMode rather than infer from OS. #730

merged 1 commit into from
May 26, 2022

Conversation

Kurt-von-Laven
Copy link
Contributor

@Kurt-von-Laven Kurt-von-Laven commented Feb 19, 2022

There was already a guard preventing the check-executables-have-shebangs hook from raising false positives on win32 by looking up the Git file mode rather than relying on the file mode in the file system. Git already automatically probes the file system for executable bit support. Leverage Git's core.fileMode config variable to prevent false positives on all file systems that don't track executable bits.

Fixes #690.

@Kurt-von-Laven Kurt-von-Laven changed the title Check Git file mode rather than infer from OS. Check Git core.fileMode rather than infer from OS. Mar 22, 2022
Copy link
Contributor Author

@Kurt-von-Laven Kurt-von-Laven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting my trailing newline ('true\n' != 'true') bug.

pre_commit_hooks/check_executables_have_shebangs.py Outdated Show resolved Hide resolved
There was already a guard preventing the check-executables-have-shebangs
hook from raising false positives on win32 by looking up the Git file
mode rather than relying on the file mode in the file system. Git already
automatically probes the file system for executable bit support. Leverage
Git's core.fileMode config variable to prevent false positives on all
file systems that don't track executable bits.
@Kurt-von-Laven
Copy link
Contributor Author

I believe this pull request is ready to be merged.

@asottile asottile merged commit 0a88f14 into pre-commit:main May 26, 2022
@Kurt-von-Laven Kurt-von-Laven deleted the support-git-file-mode-false branch May 26, 2022 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

check-executables-have-shebangs Should Check Executable Bit According to Git Rather Than File System
2 participants