1
0
mirror of https://github.com/git/git.git synced 2024-10-01 00:12:47 +02:00
Commit Graph

5 Commits

Author SHA1 Message Date
Alexander Gavrilov
a1c3feb7fa git-gui: Optimize encoding name resolution using a lookup table.
Encoding menu construction does almost a hundred of encoding
resolutions, which with the old implementation led to a
small but noticeable delay.

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>
2008-09-24 12:48:32 -07:00
Alexander Gavrilov
3fe0162362 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>
2008-09-24 12:48:32 -07:00
Alexander Gavrilov
50102c5687 git-gui: Add a menu of available encodings.
To make encoding selection easier, add a menu that
lists available encodings to the Options window.

Menu structure is borrowed from Firefox.

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>
2008-09-24 12:48:32 -07:00
Alexander Gavrilov
72e6b00202 git-gui: Cleanup handling of the default encoding.
- Make diffs and blame default to the system (locale)
  encoding instead of hard-coding UTF-8.
- Add a gui.encoding option to allow overriding it.
- gitattributes still have the final word.

The rationale for this is Windows support:

1) Windows people are accustomed to using legacy encodings
   for text files. For many of them defaulting to utf-8
   will be counter-intuitive.
2) Windows doesn't support utf-8 locales, and switching
   the system encoding is a real pain. Thus the option.

This patch also adds proper encoding conversion to Apply Hunk/Line.

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>
2008-09-24 12:48:32 -07:00
Shawn O. Pearce
c4638f662c git-gui: Translate standard encoding names to Tcl ones
This is a essentially a copy of Paul Mackerras encoding support from
gitk.  I stole the code from gitk commit fd8ccbec4f0161, as Paul has
already done all of the hard work setting up this translation table.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-19 01:27:17 -04:00