summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2018-03-15 23:57:46 +0100
committerJunio C Hamano <gitster@pobox.com>2018-03-16 10:41:31 -0700
commitb4609890875360a7f63db68652a971a5ea1f9be4 (patch)
tree22c2330bc4a5834416dbb84d7771fe3d789cd4de /Documentation
parentc1b7830e109b2a5a33ad10c9d82d330f9a6a6e17 (diff)
downloadgit-ls/checkout-encoding.tar.gz
convert: add round trip check based on 'core.checkRoundtripEncoding'ls/checkout-encoding
UTF supports lossless conversion round tripping and conversions between UTF and other encodings are mostly round trip safe as Unicode aims to be a superset of all other character encodings. However, certain encodings (e.g. SHIFT-JIS) are known to have round trip issues [1]. Add 'core.checkRoundtripEncoding', which contains a comma separated list of encodings, to define for what encodings Git should check the conversion round trip if they are used in the 'working-tree-encoding' attribute. Set SHIFT-JIS as default value for 'core.checkRoundtripEncoding'. [1] https://support.microsoft.com/en-us/help/170559/prb-conversion-problem-between-shift-jis-and-unicode Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config.txt6
-rw-r--r--Documentation/gitattributes.txt8
2 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 64c1dbba94..4859a7dedd 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -528,6 +528,12 @@ core.autocrlf::
This variable can be set to 'input',
in which case no output conversion is performed.
+core.checkRoundtripEncoding::
+ A comma and/or whitespace separated list of encodings that Git
+ performs UTF-8 round trip checks on if they are used in an
+ `working-tree-encoding` attribute (see linkgit:gitattributes[5]).
+ The default value is `SHIFT-JIS`.
+
core.symlinks::
If false, symbolic links are checked out as small plain files that
contain the link text. linkgit:git-update-index[1] and
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 31a4f92840..aa3deae392 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -312,6 +312,14 @@ number of pitfalls:
internal contents as UTF-8 and try to convert it to UTF-16 on checkout.
That operation will fail and cause an error.
+- Reencoding content to non-UTF encodings can cause errors as the
+ conversion might not be UTF-8 round trip safe. If you suspect your
+ encoding to not be round trip safe, then add it to
+ `core.checkRoundtripEncoding` to make Git check the round trip
+ encoding (see linkgit:git-config[1]). SHIFT-JIS (Japanese character
+ set) is known to have round trip issues with UTF-8 and is checked by
+ default.
+
- Reencoding content requires resources that might slow down certain
Git operations (e.g 'git checkout' or 'git add').