You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
When executing pre-commit hooks I get the following error:
Unable to commit .git/hooks/pre-commit: /f/***/***/***/***/.git/hooks/pre-commit.extension.***.GitHooks: /bin/bash^M: bad interpreter: No such file or directory
(Path above is obfuscated)
Reproduces how often:
Always
Versions
OS: Windows 10 x64 Atom: 1.18.0 x64 Atom-GitHub: 0.3.3
Additional info
Spoke with @BinaryMuse who linked me to this on StackOverflow which shows people seeing a similar non-atom related issue
I will try to debug and find more info if I can
The text was updated successfully, but these errors were encountered:
Figured out the root cause. Since i am using Windows, the git pre-commit hooks I have, have CRLF endings. This works when using git via the command line, however breaks when using via atom/github due to its dependence on dugite. When using git via dugite on a Windows machine the PATH variable is prefixed with the mingw tools distributed with git (see here), which expects UNIX style LF endings.
The quick solution for me, is to convert all of my team's pre-commit hooks to LF style endings. I'm unsure if this is anything the Atom team can do however.
Update: The line endings were just a red-herring. The actual issue was the specified interpreter of #!/bin/bash
Irrespective of line endings, the issue is fixed when changed to #!/bin/sh. So my team's pre-commit hooks were just configured incorrectly. I'm assuming this doesn't manifest in the command line because PowerShell and cmd (presumably) ignore the #! lines in the script, but mingw doesn't.
Description
When executing pre-commit hooks I get the following error:
Unable to commit
.git/hooks/pre-commit: /f/***/***/***/***/.git/hooks/pre-commit.extension.***.GitHooks: /bin/bash^M: bad interpreter: No such file or directory
(Path above is obfuscated)
Reproduces how often:
Always
Versions
OS: Windows 10 x64
Atom: 1.18.0 x64
Atom-GitHub: 0.3.3
Additional info
Spoke with @BinaryMuse who linked me to this on StackOverflow which shows people seeing a similar non-atom related issue
I will try to debug and find more info if I can
The text was updated successfully, but these errors were encountered: