GithubHelp home page GithubHelp logo

Comments (5)

mfn avatar mfn commented on June 25, 2024

Btw, works fine with 1.8.7 ; I've reverted now to Ruby 1.8.

I just realized this is kind of the same like Issue 103

from git-commit-notifier.

akzhan avatar akzhan commented on June 25, 2024

Thanks for the report.

from git-commit-notifier.

mfn avatar mfn commented on June 25, 2024

Some more information:

I tried to reproduce this problem in another environment and it worked without problems. Trying to narrow it down, I compared the locale output on both environments. In the working environment it was all set up to en_US.UTF-8. In the "problematic" environment, which is using git-http-backend via apache2, no specific locale was set, it all defaulted to POSIX.

I was able to fix this on my end up setting the post-receive hook this way:

LANG=en_US.UTF-8 GEM_HOME=... .../git-commit-notifier ...git-notifier-config.yml

Or, to describe it the other way: I can easily reproduce this problem locally when I set LANG=POSIX in the environment executing git-commit-notifier.

I found a workaround by always forcing UTF-8, because the git commands in use (git log, git show) default to UTF-8. See https://github.com/bitboxer/git-commit-notifier/pull/105 .

from git-commit-notifier.

mfn avatar mfn commented on June 25, 2024

I still have the same issue, albeit the error message is a bit different; it now references UTF-8 instead of US-ASCII; tested with master @ 36122d0 :

$ rm previously.txt; src/ruby/git-commit-notifier/local-run.rb example.yml badc3992480cbd645aa67f360c8fd7d5516fe286 b232ff2f08a24bae1c6c55df1784ccbd64291611
Sending mail...
#<Encoding:UTF-8>
src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:319:in `split': invalid byte sequence in UTF-8 (ArgumentError)
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:319:in `extract_commit_info_from_git_show_output'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:434:in `diff_for_commit'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:515:in `block in diff_between_revisions'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:512:in `each'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/diff_to_html.rb:512:in `diff_between_revisions'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/commit_hook.rb:121:in `run'
        from src/ruby/git-commit-notifier/lib/git_commit_notifier/executor.rb:23:in `run!'
        from src/ruby/git-commit-notifier/local-run.rb:22:in `<main>'

(I can't reopen the issue, no permissions)

from git-commit-notifier.

mfn avatar mfn commented on June 25, 2024

In case you want to test it yourself, here's the dummy repository I used for testing (it's a git repos in a tar.bz2): http://my-serve.rs/tmp/foo.tar.bz2 ; it contains differences in files as well as commit messages with non-US-ASCII characters. The above shown command can be simply applied to it. This was tested with locale en_US.UTF-8

from git-commit-notifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.