summaryrefslogtreecommitdiffstats
path: root/lib/commit.tcl
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2008-12-06 18:24:35 +0100
committerShawn O. Pearce <spearce@spearce.org>2008-12-08 17:33:05 +0100
commit3ac31e4451ff7c77c7ecbd639e685995e6a8dcc7 (patch)
treebbf9ca451847e9e10bfa676dec34da6b0941d19a /lib/commit.tcl
parentgit-gui: Fix handling of relative paths in blame. (diff)
downloadgit-3ac31e4451ff7c77c7ecbd639e685995e6a8dcc7.tar.xz
git-3ac31e4451ff7c77c7ecbd639e685995e6a8dcc7.zip
git-gui: Fix commit encoding handling.
Commits without an encoding header are supposed to be encoded in utf8. While this apparently hasn't always been the case, currently it is the active convention, so it is better to follow it; otherwise people who have to use commitEncoding on their machines are unable to read utf-8 commits made by others. I also think that it is preferrable to display the warning about an unsupported value of commitEncoding more prominently, because this condition may lead to surprising behavior and, eventually, to loss of data. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/commit.tcl')
-rw-r--r--lib/commit.tcl7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/commit.tcl b/lib/commit.tcl
index 334514996a..9cc8410595 100644
--- a/lib/commit.tcl
+++ b/lib/commit.tcl
@@ -27,9 +27,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
if {[catch {
set fd [git_read cat-file commit $curHEAD]
fconfigure $fd -encoding binary -translation lf
- if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
- set enc utf-8
- }
+ # By default commits are assumed to be in utf-8
+ set enc utf-8
while {[gets $fd line] > 0} {
if {[string match {parent *} $line]} {
lappend parents [string range $line 7 end]
@@ -208,7 +207,7 @@ A good commit message has the following format:
if {$use_enc ne {}} {
fconfigure $msg_wt -encoding $use_enc
} else {
- puts stderr [mc "warning: Tcl does not support encoding '%s'." $enc]
+ error_popup [mc "warning: Tcl does not support encoding '%s'." $enc]
fconfigure $msg_wt -encoding utf-8
}
puts $msg_wt $msg