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
I debugged this a bit but I'm still not sure about the proper fix... It also doesn't help that #766 didn't add a test documenting the intended behaviour of to_utf8 method 🤔
Here's a minimal Dockerfile to reproduce the bug: (note: the debian image on this Dockerfile does not define any locale; Encoding.locale_charmap returns ANSI_X3.4-1968 and the code breaks on gems/overcommit-0.59.0/lib/overcommit/subprocess.rb:105:in 'convert')
FROM debian
RUN apt update -y && apt install -y ruby git && gem install bundler overcommit
WORKDIR some-dir
# setup a git repo with a utf-8 commit messageRUN git init && \
git config --local user.name "Overcommit Tester" && \
git config --local user.email "[email protected]" && \
git commit --allow-empty -m "🤝 UTF-8 text"# add and install a pre-commit hook that checks a commit messageRUN echo "PreCommit:\n CapitalizedSubject:\n enabled: true" > .overcommit.yml && overcommit --install
# amend the commit to trigger the pre-commit hook; this raises an errorRUN git commit --amend --no-edit
If I understood it correctly, v0.59 breaks on utf8 strings for any unix system that does not define an utf8 locale.
Activity
clemens commentedon Apr 29, 2022
Here's how I've worked around it for now:
Drowze commentedon May 1, 2022
I debugged this a bit but I'm still not sure about the proper fix... It also doesn't help that #766 didn't add a test documenting the intended behaviour of
to_utf8method 🤔Here's a minimal Dockerfile to reproduce the bug:
(note: the
debianimage on this Dockerfile does not define any locale;Encoding.locale_charmapreturnsANSI_X3.4-1968and the code breaks ongems/overcommit-0.59.0/lib/overcommit/subprocess.rb:105:in 'convert')If I understood it correctly, v0.59 breaks on utf8 strings for any unix system that does not define an utf8 locale.