summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2008-01-23 00:39:50 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-24 12:48:31 -0700
commit696235c6c1c85085fd55ff849663d44c51464e69 (patch)
treed49ea9c80e1f605fc72eaeb566cb305bf2203129
parentgit-gui: Use gitattribute "encoding" for file content display (diff)
downloadtgif-696235c6c1c85085fd55ff849663d44c51464e69.tar.xz
git-gui: Assume `blame --incremental` output is in UTF-8
Most commits have author name encoded in UTF-8, but the incremental blame output dumps raw bytes and doesn't give us the encoding header from the commit. Rather than fixing up tooltip data after we have viewed that particular commit in the blame viewer we can assume all names are in UTF-8. This is still going to cause problems when the author name is not encoded in UTF-8, but the only (efficient) way to solve that is to add an "encoding" header to the blame --incremental mode output, as otherwise we need to run `git cat-file commit $sha1` for each and every commit identified and that would be horribly expensive on any platform. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--lib/blame.tcl8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 9464a599dc..7535adb97d 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -511,7 +511,7 @@ method _exec_blame {cur_w cur_d options cur_s} {
}
lappend options -- $path
set fd [eval git_read --nice blame $options]
- fconfigure $fd -blocking 0 -translation lf -encoding binary
+ fconfigure $fd -blocking 0 -translation lf -encoding utf-8
fileevent $fd readable [cb _read_blame $fd $cur_w $cur_d]
set current_fd $fd
set blame_lines 0
@@ -884,12 +884,6 @@ method _showcommit {cur_w lno} {
set enc [tcl_encoding $enc]
if {$enc ne {}} {
set msg [encoding convertfrom $enc $msg]
- set author_name [encoding convertfrom $enc $author_name]
- set committer_name [encoding convertfrom $enc $committer_name]
- set header($cmit,author) $author_name
- set header($cmit,committer) $committer_name
- set header($cmit,summary) \
- [encoding convertfrom $enc $header($cmit,summary)]
}
set msg [string trim $msg]
}