A coworker pushed a few commits, one of which added a new PDF file in a branch. He got this error:
remote: Sending mail...
remote: /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:541:in `iconv': "\223\214\213\236 ReportLab G"... (Iconv::IllegalSequence)
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:541:in `diff_for_commit'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:713:in `diff_for_branch'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:712:in `each'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:712:in `diff_for_branch'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/diff_to_html.rb:761:in `diff_between_revisions'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/commit_hook.rb:241:in `run'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/executor.rb:29:in `run!'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/executor.rb:27:in `each_line'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/lib/git_commit_notifier/executor.rb:27:in `run!'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.11.11mg2/bin/git-commit-notifier:15
remote: from /usr/local/bin/git-commit-notifier:19:in `load'
remote: from /usr/local/bin/git-commit-notifier:19
I can reproduce it with today's master.
In case it matters, I have a .gitattributes file in that branch that contains *.pdf binary.
Ideally, git-commit-notifier wouldn't try to diff PDFs at all, as per .gitattributes, but I'll settle for not crashing and omitting emails of this and all other commits in that particular push. ;-)
I'm running into this issue from time to time. It also occurs when a source file (*.cpp) contains a non-ascii character. Is it possible to work-around this issue. E.g. skip the problematic file in the diff, but keep generating the diff for all unaffected files?
Activity
hcoyote commented on Jul 26, 2013
We've experienced this same issue today, but with an html file that happened to contain some extended ascii.
In this case, it was \251 (or the copyright symbol).
Based on this and this, I'm wondering if the wrong encoding is also being detected here as well.
aroth-fastprotect commented on Nov 18, 2013
I'm running into this issue from time to time. It also occurs when a source file (*.cpp) contains a non-ascii character. Is it possible to work-around this issue. E.g. skip the problematic file in the diff, but keep generating the diff for all unaffected files?
akzhan commented on Nov 18, 2013
Please try to use Ruby 1.9 or above as workaround for this issue.
Will investigate later.
akzhan commented on Nov 18, 2013
And I will think about .gitattributes. We use usual git show so need to investigate this too.
aroth-fastprotect commented on Nov 18, 2013
Thanks for your hints. I'll test and get back soon.