<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert.c, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-08T06:59:22Z</updated>
<entry>
<title>Merge branch 'ls/checkout-encoding'</title>
<updated>2018-05-08T06:59:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-08T06:59:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ac0ce4d32ab7a3546e7e84a562625576208c7db'/>
<id>urn:sha1:1ac0ce4d32ab7a3546e7e84a562625576208c7db</id>
<content type='text'>
The new "checkout-encoding" attribute can ask Git to convert the
contents to the specified encoding when checking out to the working
tree (and the other way around when checking in).

* ls/checkout-encoding:
  convert: add round trip check based on 'core.checkRoundtripEncoding'
  convert: add tracing for 'working-tree-encoding' attribute
  convert: check for detectable errors in UTF encodings
  convert: add 'working-tree-encoding' attribute
  utf8: add function to detect a missing UTF-16/32 BOM
  utf8: add function to detect prohibited UTF-16/32 BOM
  utf8: teach same_encoding() alternative UTF encoding names
  strbuf: add a case insensitive starts_with()
  strbuf: add xstrdup_toupper()
  strbuf: remove unnecessary NUL assignment in xstrdup_tolower()
</content>
</entry>
<entry>
<title>convert: add round trip check based on 'core.checkRoundtripEncoding'</title>
<updated>2018-04-16T02:40:56Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2018-04-15T18:16:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e92d6225361eba5ff34696122d1491dc7ace2a5a'/>
<id>urn:sha1:e92d6225361eba5ff34696122d1491dc7ace2a5a</id>
<content type='text'>
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 &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: add tracing for 'working-tree-encoding' attribute</title>
<updated>2018-04-16T02:40:56Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2018-04-15T18:16:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=541d059cd903bb8e510f876ea2bc33719b76b33c'/>
<id>urn:sha1:541d059cd903bb8e510f876ea2bc33719b76b33c</id>
<content type='text'>
Add the GIT_TRACE_WORKING_TREE_ENCODING environment variable to enable
tracing for content that is reencoded with the 'working-tree-encoding'
attribute. This is useful to debug encoding issues.

Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: check for detectable errors in UTF encodings</title>
<updated>2018-04-16T02:40:56Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2018-04-15T18:16:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a17918c34f4e83982456ffe22d880c3cda5384f'/>
<id>urn:sha1:7a17918c34f4e83982456ffe22d880c3cda5384f</id>
<content type='text'>
Check that new content is valid with respect to the user defined
'working-tree-encoding' attribute.

Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: add 'working-tree-encoding' attribute</title>
<updated>2018-04-16T02:40:56Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2018-04-15T18:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=107642fe2661236f48b912480e090799e339c512'/>
<id>urn:sha1:107642fe2661236f48b912480e090799e339c512</id>
<content type='text'>
Git recognizes files encoded with ASCII or one of its supersets (e.g.
UTF-8 or ISO-8859-1) as text files. All other encodings are usually
interpreted as binary and consequently built-in Git text processing
tools (e.g. 'git diff') as well as most Git web front ends do not
visualize the content.

Add an attribute to tell Git what encoding the user has defined for a
given file. If the content is added to the index, then Git reencodes
the content to a canonical UTF-8 representation. On checkout Git will
reverse this operation.

Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: convert to struct object_id</title>
<updated>2018-03-14T16:23:50Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a750441a7360b29fff7a414649ece1d35acaca6'/>
<id>urn:sha1:1a750441a7360b29fff7a414649ece1d35acaca6</id>
<content type='text'>
Convert convert.c to struct object_id.  Add a use of the_hash_algo to
replace hard-coded constants and change a strbuf_add to a strbuf_addstr
to avoid another hard-coded constant.

Note that a strict conversion using the hexsz constant would cause
problems in the future if the internal and user-visible hash algorithms
differed, as anticipated by the hash function transition plan.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'po/object-id'</title>
<updated>2018-02-15T22:55:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-02-15T22:55:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8be8342b4c47df386c6eced39922595d7dfdccc9'/>
<id>urn:sha1:8be8342b4c47df386c6eced39922595d7dfdccc9</id>
<content type='text'>
Conversion from uchar[20] to struct object_id continues.

* po/object-id:
  sha1_file: rename hash_sha1_file_literally
  sha1_file: convert write_loose_object to object_id
  sha1_file: convert force_object_loose to object_id
  sha1_file: convert write_sha1_file to object_id
  notes: convert write_notes_tree to object_id
  notes: convert combine_notes_* to object_id
  commit: convert commit_tree* to object_id
  match-trees: convert splice_tree to object_id
  cache: clear whole hash buffer with oidclr
  sha1_file: convert hash_sha1_file to object_id
  dir: convert struct sha1_stat to use object_id
  sha1_file: convert pretend_sha1_file to object_id
</content>
</entry>
<entry>
<title>sha1_file: convert hash_sha1_file to object_id</title>
<updated>2018-01-30T18:42:36Z</updated>
<author>
<name>Patryk Obara</name>
<email>patryk.obara@gmail.com</email>
</author>
<published>2018-01-28T00:13:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f070faccc1a446e44463560add8434efa8c6bed1'/>
<id>urn:sha1:f070faccc1a446e44463560add8434efa8c6bed1</id>
<content type='text'>
Convert the declaration and definition of hash_sha1_file to use
struct object_id and adjust all function calls.

Rename this function to hash_object_file.

Signed-off-by: Patryk Obara &lt;patryk.obara@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert_to_git(): safe_crlf/checksafe becomes int conv_flags</title>
<updated>2018-01-16T20:35:56Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2018-01-13T22:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8462ff43e42ab67cecd16fdfb59451a53cc8a945'/>
<id>urn:sha1:8462ff43e42ab67cecd16fdfb59451a53cc8a945</id>
<content type='text'>
When calling convert_to_git(), the checksafe parameter defined what
should happen if the EOL conversion (CRLF --&gt; LF --&gt; CRLF) does not
roundtrip cleanly. In addition, it also defined if line endings should
be renormalized (CRLF --&gt; LF) or kept as they are.

checksafe was an safe_crlf enum with these values:
SAFE_CRLF_FALSE:       do nothing in case of EOL roundtrip errors
SAFE_CRLF_FAIL:        die in case of EOL roundtrip errors
SAFE_CRLF_WARN:        print a warning in case of EOL roundtrip errors
SAFE_CRLF_RENORMALIZE: change CRLF to LF
SAFE_CRLF_KEEP_CRLF:   keep all line endings as they are

In some cases the integer value 0 was passed as checksafe parameter
instead of the correct enum value SAFE_CRLF_FALSE. That was no problem
because SAFE_CRLF_FALSE is defined as 0.

FALSE/FAIL/WARN are different from RENORMALIZE and KEEP_CRLF. Therefore,
an enum is not ideal. Let's use a integer bit pattern instead and rename
the parameter to conv_flags to make it more generically usable. This
allows us to extend the bit pattern in a subsequent commit.

Reported-By: Randall S. Becker &lt;rsbecker@nexbridge.com&gt;
Helped-By: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/check-crlf-for-safe-crlf'</title>
<updated>2017-12-27T19:16:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-12-27T19:16:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=720b1764def1cfd67004d917ec954df20983e6bb'/>
<id>urn:sha1:720b1764def1cfd67004d917ec954df20983e6bb</id>
<content type='text'>
The "safe crlf" check incorrectly triggered for contents that does
not use CRLF as line endings, which has been corrected.

* tb/check-crlf-for-safe-crlf:
  t0027: Adapt the new MIX tests to Windows
  convert: tighten the safe autocrlf handling
</content>
</entry>
</feed>
