git-gui: Allow forcing display encoding for diffs using a submenu.

Add a submenu to allow dynamically changing the encoding to use
for diffs. Encoding settings are remembered while git-gui runs.
The rules are:

1) Encoding set for a specific file overrides gitattributes.
2) Last explicitly set value of the encoding overrides gui.encoding

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Alexander Gavrilov
2008-09-18 01:07:34 +04:00
committed by Shawn O. Pearce
parent 50102c5687
commit 3fe0162362
3 changed files with 44 additions and 2 deletions

View File

@ -40,6 +40,15 @@ proc reshow_diff {} {
}
}
proc force_diff_encoding {enc} {
global current_diff_path
if {$current_diff_path ne {}} {
force_path_encoding $current_diff_path $enc
reshow_diff
}
}
proc handle_empty_diff {} {
global current_diff_path file_states file_lists