<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert.h, 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 '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>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/apply-with-crlf'</title>
<updated>2017-08-27T05:55:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-27T05:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a17483fcfe313e9ff5b9b0eb8245605fe7f66ea7'/>
<id>urn:sha1:a17483fcfe313e9ff5b9b0eb8245605fe7f66ea7</id>
<content type='text'>
"git apply" that is used as a better "patch -p1" failed to apply a
taken from a file with CRLF line endings to a file with CRLF line
endings.  The root cause was because it misused convert_to_git()
that tried to do "safe-crlf" processing by looking at the index
entry at the same path, which is a nonsense---in that mode, "apply"
is not working on the data in (or derived from) the index at all.
This has been fixed.

* tb/apply-with-crlf:
  apply: file commited with CRLF should roundtrip diff and apply
  convert: add SAFE_CRLF_KEEP_CRLF
</content>
</entry>
<entry>
<title>convert: add SAFE_CRLF_KEEP_CRLF</title>
<updated>2017-08-16T17:21:17Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2017-08-13T08:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fea9de61857986431982ae89c01c89a2fc10038'/>
<id>urn:sha1:2fea9de61857986431982ae89c01c89a2fc10038</id>
<content type='text'>
When convert_to_git() is called, the caller may want to keep CRLF to
be kept as CRLF (and not converted into LF).

This will be used in the next commit, when apply works with files
that have CRLF and patches are applied onto these files.

Add the new value "SAFE_CRLF_KEEP_CRLF" to safe_crlf.

Prepare convert_to_git() to be able to run the clean filter, skip
the CRLF conversion and run the ident filter.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ls/filter-process-delayed'</title>
<updated>2017-08-11T20:27:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-11T20:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51b8aecabed1363f13c990320a50e1fb2aa3f696'/>
<id>urn:sha1:51b8aecabed1363f13c990320a50e1fb2aa3f696</id>
<content type='text'>
The filter-process interface learned to allow a process with long
latency give a "delayed" response.

* ls/filter-process-delayed:
  convert: add "status=delayed" to filter process protocol
  convert: refactor capabilities negotiation
  convert: move multiple file filter error handling to separate function
  convert: put the flags field before the flag itself for consistent style
  t0021: write "OUT &lt;size&gt;" only on success
  t0021: make debug log file name configurable
  t0021: keep filter log files on comparison
</content>
</entry>
<entry>
<title>convert: add "status=delayed" to filter process protocol</title>
<updated>2017-06-30T20:50:41Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2017-06-30T20:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2841e8f81cb2820024804b9341577be1d0ce1240'/>
<id>urn:sha1:2841e8f81cb2820024804b9341577be1d0ce1240</id>
<content type='text'>
Some `clean` / `smudge` filters may require a significant amount of
time to process a single blob (e.g. the Git LFS smudge filter might
perform network requests). During this process the Git checkout
operation is blocked and Git needs to wait until the filter is done to
continue with the checkout.

Teach the filter process protocol, introduced in edcc8581 ("convert: add
filter.&lt;driver&gt;.process option", 2016-10-16), to accept the status
"delayed" as response to a filter request. Upon this response Git
continues with the checkout operation. After the checkout operation Git
calls "finish_delayed_checkout" which queries the filter for remaining
blobs. If the filter is still working on the completion, then the filter
is expected to block. If the filter has completed all remaining blobs
then an empty response is expected.

Git has a multiple code paths that checkout a blob. Support delayed
checkouts only in `clone` (in unpack-trees.c) and `checkout` operations
for now. The optimization is most effective in these code paths as all
files of the tree are processed.

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 renormalize_buffer to take an index</title>
<updated>2017-06-13T18:40:51Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-06-12T22:13:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a33e0b2a77d7010ba8bf0e025fffaf98f464a938'/>
<id>urn:sha1:a33e0b2a77d7010ba8bf0e025fffaf98f464a938</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
