question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

check-executables-have-shebangs not correct on windows

See original GitHub issue

does not seem to work right on windows

i am dealing with a primarily linux / python project but on a windows machine.

i have set git config core.filemode false

i created a new file and stage and i verify that filemode is 644:

>git ls-files -s newfile.py
100644 3edd36f71bf2081c70a0eaf39dec6980d0a9f791 0       newfile.py

but hook still fails

hookid: check-executables-have-shebangs

newfile.py: marked executable but has no (or invalid) shebang!
  If it isn't supposed to be executable, try: chmod -x newfile.py
  If it is supposed to be executable, double-check its shebang.

why is this file causing error?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Jifyycommented, Feb 11, 2022

I bypassed the issue by running this command in my Windows Powershell.

git update-index --chmod=+x .\filename.py

1reaction
dstandishcommented, Jan 11, 2020

so perhaps it could look at what it set in core.filemode

if false that means “can’t trust os filemode”

so if false, then look at git filemode; otherwise, os is fine?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checks that non-binary executables have a proper shebang.
Tuto git check-executables-have-shebangs checks that non-binary executables have a proper shebang.
Read more >
Should I put #! (shebang) in Python scripts, and what form ...
The shebang line in any script determines the script's ability to be executed like a standalone executable without typing python beforehand in the...
Read more >
refs/tags/v4.1.0 - pre-commit-hooks - Git at Google
Checks that non-binary executables have a proper shebang. check-json. Attempts to load all json files to verify syntax. check-merge-conflict. Check for ...
Read more >
Python Shebangs on Windows - assert_not magic?
So, to ensure that you're set up right, run the “Default Programs” application and make sure Python files are associated with the C:\WINDOWS\py....
Read more >
Differences between Windows PowerShell 5.1 and ...
Skip null-element check for collections with a value-type element type ... and array expressions @() so that $? is not automatically true.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found