• Torsten Bögershausen's avatar
    convert: unify the "auto" handling of CRLF · 65237284
    Torsten Bögershausen authored
    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: default avatarTorsten Bögershausen <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
    65237284
convert.h 2.56 KB