Defect #14931

SCM annotate with non ASCII author

Added by Kęstutis Paulikas about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:SCM
Target version:2.3.4
Resolution:Fixed Affected version:2.3.2

Description

If author field in git commit contains UTF8 symbols, Repository Annotate page crashes with the following messages in the production.log:

Started GET "/projects/p175b304/repository/revisions/master/annotate/crash.c" for 192.168.1.10 at 2013-09-17 01:58:02 +0300
Processing by RepositoriesController#annotate as HTML
  Parameters: {"id"=>"p175b304", "rev"=>"master", "path"=>"crash.c"}
  Current user: admin (id=1)
  Rendered repositories/_navigation.html.erb (58.6ms)
  Rendered repositories/_breadcrumbs.html.erb (4.0ms)
  Rendered repositories/_link_to_functions.html.erb (3.7ms)
  Rendered repositories/annotate.html.erb within layouts/base (91.9ms)
Completed 500 Internal Server Error in 329ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    55:         <%= yield :sidebar %>
    56:         <%= view_layouts_base_sidebar_hook_response %>
    57:     </div>
    58: 
    59:     <div id="content">
    60:         <%= render_flash_messages %>
    61:         <%= yield %>
  app/views/layouts/base.html.erb:58:in `_app_views_layouts_base_html_erb___1550060124232729327_17288283060'

Atatched patch fixed the problem for me, but I'm not familiar with ruby/rails, so I'm not sure if it is a correct solution.

Environment:
Redmine version 2.3.2.stable
Ruby version 1.9.3-p448 (2013-06-27) [amd64-freebsd9]
Rails version 3.2.13
Environment production
Database adapter SQLite
Redmine plugins:
no plugin installed

git_adapter.rb.patch Magnifier - FIX (663 Bytes) Kęstutis Paulikas, 2013-09-17 15:59

Associated revisions

Revision 12138
Added by Toshi MARUYAMA about 4 years ago

code format cleanup app/views/repositories/annotate.html.erb (#14931)

Revision 12139
Added by Toshi MARUYAMA about 4 years ago

fix test failure (#14931)

Revision 12140
Added by Toshi MARUYAMA about 4 years ago

use assert_select instead of assert_tag in Mercurial annotate test (#14931)

Revision 12141
Added by Toshi MARUYAMA about 4 years ago

use assert_select instead of assert_tag in Bazaar annotate test (#14931)

Revision 12142
Added by Toshi MARUYAMA about 4 years ago

scm: git: change non ASCII user name variable to instance variable (#14931)

Revision 12143
Added by Toshi MARUYAMA about 4 years ago

scm: git: use "--encoding=UTF-8" for blame (#14931)

Revision 12144
Added by Toshi MARUYAMA about 4 years ago

Merged r12139, r12140 and r12141 from trunk to 2.3-stable (#14931)

Revision 12145
Added by Toshi MARUYAMA about 4 years ago

Merged r12142 from trunk to 2.3-stable (#14931)

scm: git: change non ASCII user name variable to instance variable.

Revision 12146
Added by Toshi MARUYAMA about 4 years ago

scm: bazaar: split REPOSITORY_PATH to trunk in functional test (#14931)

Revision 12147
Added by Toshi MARUYAMA about 4 years ago

scm: bazaar: update test repository for author html escaping (#14931)

  • run "bzr branch --no-tree branch00 author_escaping"
  • add revision to this branch

Revision 12148
Added by Toshi MARUYAMA about 4 years ago

scm: bazaar: add test for author html escaping (#14931)

Revision 12149
Added by Toshi MARUYAMA about 4 years ago

scm: remove unnecessary h() from annotate author (#14931)

Rails3 escapes by default.

Revision 12150
Added by Toshi MARUYAMA about 4 years ago

use assert_select instead of assert_tag in Git non ASCII path annotate test (#14931)

Revision 12151
Added by Toshi MARUYAMA about 4 years ago

Merged r12146, r12147 and r12148 from trunk to 2.3-stable (#14931)

Revision 12152
Added by Toshi MARUYAMA about 4 years ago

Merged r12150 from trunk to 2.3-stable (#14931)

use assert_select instead of assert_tag in Git non ASCII path annotate test.

Revision 12153
Added by Toshi MARUYAMA about 4 years ago

scm: git: fix indents of non ASCII path annotate test (#14931)

Revision 12154
Added by Toshi MARUYAMA about 4 years ago

Merged r12153 from trunk to 2.3-stable (#14931)

scm: git: fix indents of non ASCII path annotate test.

Revision 12155
Added by Toshi MARUYAMA about 4 years ago

scm: bazaar: update test repository for non ASCII author (#14931)

  • run "bzr branch --no-tree branch00 author_non_ascii"
  • add revision to this branch

Revision 12156
Added by Toshi MARUYAMA about 4 years ago

scm: fix annotate error with non ASCII author on Ruby 1.9 and Ruby 2.0 (#14931)

Revision 12157
Added by Toshi MARUYAMA about 4 years ago

remove trailing white-space from test/functional/repositories_bazaar_controller_test.rb (#14931)

Revision 12158
Added by Toshi MARUYAMA about 4 years ago

Merged r12155 from trunk to 2.3-stable (#14931)

scm: bazaar: update test repository for non ASCII author.

  • run "bzr branch --no-tree branch00 author_non_ascii"
  • add revision to this branch

Revision 12159
Added by Toshi MARUYAMA about 4 years ago

Merged r12143 from trunk to 2.3-stable (#14931)

scm: git: use "--encoding=UTF-8" for blame.

Revision 12160
Added by Toshi MARUYAMA about 4 years ago

Merged r12138, r12149, r12156 and r12157 from trunk to 2.3-stable (#14931)

scm: fix annotate error with non ASCII author on Ruby 1.9 and Ruby 2.0.

History

#1 Updated by Toshi MARUYAMA about 4 years ago

  • Category set to SCM

#2 Updated by Toshi MARUYAMA about 4 years ago

  • Assignee set to Toshi MARUYAMA
  • Target version set to 2.3.4
  • Resolution set to Cant reproduce

#3 Updated by Toshi MARUYAMA about 4 years ago

  • Resolution deleted (Cant reproduce)

#5 Updated by Toshi MARUYAMA about 4 years ago

  • Subject changed from Git annotate with UTF8 author to SCM annotate with non ASCII author

#6 Updated by Toshi MARUYAMA about 4 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Fixed in trunk and 2.3-stable.

Also available in: Atom PDF