<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert.c, branch v2.8.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.8.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.8.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-02-26T21:37:23Z</updated>
<entry>
<title>Merge branch 'tb/conversion'</title>
<updated>2016-02-26T21:37:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-26T21:37:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6b94eb0093216f7a02a8c7a350d1760478a52a1'/>
<id>urn:sha1:c6b94eb0093216f7a02a8c7a350d1760478a52a1</id>
<content type='text'>
Code simplification.

* tb/conversion:
  convert.c: correct attr_action()
  convert.c: simplify text_stat
  convert.c: refactor crlf_action
  convert.c: use text_eol_is_crlf()
  convert.c: remove input_crlf_action()
  convert.c: remove unused parameter 'path'
  t0027: add tests for get_stream_filter()
</content>
</entry>
<entry>
<title>convert.c: correct attr_action()</title>
<updated>2016-02-23T20:53:15Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-23T17:07:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=817a0c7968c1d7e0f574b6d07451445832f781aa'/>
<id>urn:sha1:817a0c7968c1d7e0f574b6d07451445832f781aa</id>
<content type='text'>
df747b81 (convert.c: refactor crlf_action, 2016-02-10) introduced a
bug to "git ls-files --eol".

The "text" attribute was shown as "text eol=lf" or "text eol=crlf",
depending on core.autocrlf or core.eol.

Correct this and add test cases in t0027.

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>convert.c: simplify text_stat</title>
<updated>2016-02-10T23:54:20Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-10T16:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e336a530b0dd98d1c751440ca5666a6999ab020'/>
<id>urn:sha1:6e336a530b0dd98d1c751440ca5666a6999ab020</id>
<content type='text'>
Simplify the statistics:
lonecr counts the CR which is not followed by a LF,
lonelf counts the LF which is not preceded by a CR,
crlf counts CRLF combinations.
This simplifies the evaluation of the statistics.

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>convert.c: refactor crlf_action</title>
<updated>2016-02-10T23:53:35Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-10T16:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df747b818f0c9b7d0db1d7e3837b78e5d48b6fde'/>
<id>urn:sha1:df747b818f0c9b7d0db1d7e3837b78e5d48b6fde</id>
<content type='text'>
Refactor the determination and usage of crlf_action.
Today, when no "crlf" attribute are set on a file, crlf_action is set to
CRLF_GUESS. Use CRLF_UNDEFINED instead, and search for "text" or "eol" as
before.
After searching for line ending attributes, save the value in
struct conv_attrs.crlf_action attr_action,
so that get_convert_attr_ascii() is able report the attributes.

Replace the old CRLF_GUESS usage:
CRLF_GUESS &amp;&amp; core.autocrlf=true -&gt; CRLF_AUTO_CRLF
CRLF_GUESS &amp;&amp; core.autocrlf=false -&gt; CRLF_BINARY
CRLF_GUESS &amp;&amp; core.autocrlf=input -&gt; CRLF_AUTO_INPUT

Save the action in conv_attrs.crlf_action (as before) and change
all callers.

Make more clear, what is what, by defining:

- CRLF_UNDEFINED : No attributes set. Temparally used, until core.autocrlf
                   and core.eol is evaluated and one of CRLF_BINARY,
                   CRLF_AUTO_INPUT or CRLF_AUTO_CRLF is selected
- CRLF_BINARY    : No processing of line endings.
- CRLF_TEXT      : attribute "text" is set, line endings are processed.
- CRLF_TEXT_INPUT: attribute "input" or "eol=lf" is set. This implies text.
- CRLF_TEXT_CRLF : attribute "eol=crlf" is set. This implies text.
- CRLF_AUTO      : attribute "auto" is set.
- CRLF_AUTO_INPUT: core.autocrlf=input (no attributes)
- CRLF_AUTO_CRLF : core.autocrlf=true  (no attributes)

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/clean-smudge-override-in-config'</title>
<updated>2016-02-10T22:20:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-10T22:20:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a3764e7da7ae2c30e2e1bbeaa0961a17bced2078'/>
<id>urn:sha1:a3764e7da7ae2c30e2e1bbeaa0961a17bced2078</id>
<content type='text'>
Clean/smudge filters defined in a configuration file of lower
precedence can now be overridden to be a pass-through no-op by
setting the variable to an empty string.

* ls/clean-smudge-override-in-config:
  convert: treat an empty string for clean/smudge filters as "cat"
</content>
</entry>
<entry>
<title>convert.c: use text_eol_is_crlf()</title>
<updated>2016-02-08T18:02:12Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-05T16:13:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b4024f5ddca2ac14c2b15158d7cca888a8ae25e'/>
<id>urn:sha1:4b4024f5ddca2ac14c2b15158d7cca888a8ae25e</id>
<content type='text'>
Add a helper function to find out, which line endings text files
should get at checkout, depending on core.autocrlf and core.eol
configuration variables.

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>convert.c: remove input_crlf_action()</title>
<updated>2016-02-08T18:01:40Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-05T16:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb211b4de83b7cbc93049bc0d73883083a6a8b0b'/>
<id>urn:sha1:bb211b4de83b7cbc93049bc0d73883083a6a8b0b</id>
<content type='text'>
Integrate the code of input_crlf_action() into convert_attrs(),
so that ca.crlf_action is always valid after calling convert_attrs().
Keep a copy of crlf_action in attr_action, this is needed for
get_convert_attr_ascii().

Remove eol_attr from struct conv_attrs, as it is now used temporally.

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>convert.c: remove unused parameter 'path'</title>
<updated>2016-02-08T17:59:43Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-02-05T16:13:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92cce1355ed4d2eb674b0742b00cfa133a4a8d58'/>
<id>urn:sha1:92cce1355ed4d2eb674b0742b00cfa133a4a8d58</id>
<content type='text'>
Some functions get a parameter path, but don't use it.
Remove the unused parameter.

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>convert: treat an empty string for clean/smudge filters as "cat"</title>
<updated>2016-01-29T19:04:27Z</updated>
<author>
<name>Lars Schneider</name>
<email>larsxschneider@gmail.com</email>
</author>
<published>2016-01-29T08:21:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a8630dc3b1cc6f1361a4e5d94630133c24c97d9'/>
<id>urn:sha1:1a8630dc3b1cc6f1361a4e5d94630133c24c97d9</id>
<content type='text'>
Once a lower-priority configuration file defines a clean or smudge
filter, there is no convenient way to override it to produce as-is
output.  Even though the configuration mechanism implements "the
last one wins" semantics, you cannot set them to an empty string and
expect them to work, as apply_filter() would try to run the empty
string as an external command and fail.  The conversion is not done,
but the function would still report a failure to convert.

Even though resetting the variable to "cat" (i.e. pass the data back
as-is and report success) is an obvious and a viable way to solve
this, it is wasteful to spawn an external process just as a
workaround.

Instead, teach apply_filter() to treat an empty string as a no-op
filter that always returns successfully its input as-is without
conversion.

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>ls-files: add eol diagnostics</title>
<updated>2016-01-19T03:48:43Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2016-01-16T06:50:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a7630bd4274a0dff7cff8b92de3d3f064e321359'/>
<id>urn:sha1:a7630bd4274a0dff7cff8b92de3d3f064e321359</id>
<content type='text'>
When working in a cross-platform environment, a user may want to
check if text files are stored normalized in the repository and
if .gitattributes are set appropriately.

Make it possible to let Git show the line endings in the index and
in the working tree and the effective text/eol attributes.

The end of line ("eolinfo") are shown like this:

    "-text"        binary (or with bare CR) file
    "none"         text file without any EOL
    "lf"           text file with LF
    "crlf"         text file with CRLF
    "mixed"        text file with mixed line endings.

The effective text/eol attribute is one of these:

    "", "-text", "text", "text=auto", "text eol=lf", "text eol=crlf"

git ls-files --eol gives an output like this:

    i/none   w/none   attr/text=auto      t/t5100/empty
    i/-text  w/-text  attr/-text          t/test-binary-2.png
    i/lf     w/lf     attr/text eol=lf    t/t5100/rfc2047-info-0007
    i/lf     w/crlf   attr/text eol=crlf  doit.bat
    i/mixed  w/mixed  attr/               locale/XX.po

to show what eol convention is used in the data in the index ('i'),
and in the working tree ('w'), and what attribute is in effect,
for each path that is shown.

Add test cases in t0027.

Helped-By: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
