Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Suddenly started to get errors when committing #7

Open
NielsKSchjoedt opened this issue Aug 19, 2014 · 1 comment
Open

Suddenly started to get errors when committing #7

NielsKSchjoedt opened this issue Aug 19, 2014 · 1 comment

Comments

@NielsKSchjoedt
Copy link

Without any indication as to why, I suddenly started to get the following errors when I commit:

.git/hooks/pre-commit:40:in `split': invalid byte sequence in US-ASCII (ArgumentError)
    from .git/hooks/pre-commit:40:in `block (2 levels) in <main>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:217:in `popen_run'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open3.rb:99:in `popen3'
    from .git/hooks/pre-commit:39:in `block in <main>'
    from .git/hooks/pre-commit:28:in `each'
    from .git/hooks/pre-commit:28:in `inject'
    from .git/hooks/pre-commit:28:in `<main>'
 (1)

If I then add # encoding: utf-8 to the top of the file, I get:

.git/hooks/pre-commit: line 12: require: command not found
.git/hooks/pre-commit: line 13: include: command not found
.git/hooks/pre-commit: line 16: syntax error near unexpected token `('
.git/hooks/pre-commit: line 16: `stop_on_warnings = (`git config --bool hooks.stop-on-warnings` != "false\n")'
 (1)

I haven't changed anything in the script, it's exactly like the one here in the repository.

@cypher
Copy link
Owner

cypher commented Sep 14, 2014

Did you add the "encoding" line at the very first line? This is where the she-bang is supposed to be, and from the second error message, it looks like that broke the script.

I've committed an update to the script, could you try the updated version?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants