]> git.ipfire.org Git - thirdparty/git.git/commit - convert.c
convert: unify the "auto" handling of CRLF
authorTorsten Bögershausen <tboegi@web.de>
Tue, 28 Jun 2016 08:01:13 +0000 (10:01 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 18:53:51 +0000 (11:53 -0700)
commit6523728499e77afaed0008875b19b308682c3f88
tree7b132c36c7f8b51ea7e1e7a85d7995617712f504
parentcaa47adc5a68045bfb9e88fcfee0e50589d129df
convert: unify the "auto" handling of CRLF

Before this change,
$ echo "* text=auto" >.gitattributes
$ echo "* eol=crlf" >>.gitattributes

would have the same effect as
$ echo "* text" >.gitattributes
$ git config core.eol crlf

Since the 'eol' attribute had higher priority than 'text=auto', this may
corrupt binary files and is not what most users expect to happen.

Make the 'eol' attribute to obey 'text=auto' and now
$ echo "* text=auto" >.gitattributes
$ echo "* eol=crlf" >>.gitattributes
behaves the same as
$ echo "* text=auto" >.gitattributes
$ git config core.eol crlf

In other words,
$ echo "* text=auto eol=crlf" >.gitattributes
has the same effect as
$ git config core.autocrlf true

and
$ echo "* text=auto eol=lf" >.gitattributes
has the same effect as
$ git config core.autocrlf input

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
Documentation/gitattributes.txt
convert.c
convert.h
t/t0025-crlf-auto.sh
t/t0027-auto-crlf.sh
t/t6038-merge-text-auto.sh