git-gui: translation binary defines iso8859-1

git-gui has many cases where -translation binary and -encoding binary are configured on the same channel. But, -translation binary defines a binary channel, which sets up -encoding iso8859-1 as part of its work. Tcl 8.x defines -encoding binary as an alias of -encoding iso8859-1, and this alias is deleted in Tcl 9.0. Let's delete the redundant encoding definition now. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>

Mark Levedahl committed May 22, 2025 at 13:17 UTC f6d3ee2014e4a553ef6b783dc5d6b2d53ee70168
4 files changed +5 -9
git-gui.sh
+3 -3
@@ -1406,15 +1406,15 @@ proc rescan_stage2 {fd after} {
1406 set fd_di [git_read [list diff-index --cached --ignore-submodules=dirty -z [PARENT]]]
1407 set fd_df [git_read [list diff-files -z]]
1408
1409 - fconfigure $fd_di -blocking 0 -translation binary -encoding binary
1410 - fconfigure $fd_df -blocking 0 -translation binary -encoding binary
1409 + fconfigure $fd_di -blocking 0 -translation binary
1410 + fconfigure $fd_df -blocking 0 -translation binary
1411
1412 fileevent $fd_di readable [list read_diff_index $fd_di $after]
1413 fileevent $fd_df readable [list read_diff_files $fd_df $after]
1414
1415 if {[is_config_true gui.displayuntracked]} {
1416 set fd_lo [git_read [concat ls-files --others -z $ls_others]]
1417 - fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
1417 + fconfigure $fd_lo -blocking 0 -translation binary
1418 fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
1419 incr rescan_active
1420 }
lib/blame.tcl
-1
@@ -1142,7 +1142,6 @@ method _blameparent {} {
1142
1143 fconfigure $fd \
1144 -blocking 0 \
1145 - -encoding binary \
1145 -translation binary
1146 fileevent $fd readable [cb _read_diff_load_commit \
1147 $fd $cparent $new_path $r_orig_line]
lib/index.tcl
-3
@@ -78,7 +78,6 @@ proc update_indexinfo {msg path_list after} {
78 -blocking 0 \
79 -buffering full \
80 -buffersize 512 \
81 - -encoding binary \
81 -translation binary
82 fileevent $fd writable [list \
83 write_update_indexinfo \
@@ -147,7 +146,6 @@ proc update_index {msg path_list after} {
146 -blocking 0 \
147 -buffering full \
148 -buffersize 512 \
150 - -encoding binary \
149 -translation binary
150 fileevent $fd writable [list \
151 write_update_index \
@@ -227,7 +225,6 @@ proc checkout_index {msg path_list after capture_error} {
225 -blocking 0 \
226 -buffering full \
227 -buffersize 512 \
230 - -encoding binary \
228 -translation binary
229 fileevent $fd writable [list \
230 write_checkout_index \
lib/mergetool.tcl
+2 -2
@@ -90,7 +90,7 @@ proc merge_load_stages {path cont} {
90
91 set merge_stages_fd [git_read [list ls-files -u -z -- $path]]
92
93 - fconfigure $merge_stages_fd -blocking 0 -translation binary -encoding binary
93 + fconfigure $merge_stages_fd -blocking 0 -translation binary
94 fileevent $merge_stages_fd readable [list read_merge_stages $merge_stages_fd $cont]
95 }
96
@@ -370,7 +370,7 @@ proc merge_tool_start {cmdline target backup stages} {
370
371 ui_status [mc "Running merge tool..."]
372
373 - fconfigure $mtool_fd -blocking 0 -translation binary -encoding binary
373 + fconfigure $mtool_fd -blocking 0 -translation binary
374 fileevent $mtool_fd readable [list read_mtool_output $mtool_fd]
375 }
376