Skip to content
  • Torsten Bögershausen's avatar
    convert: unify the "auto" handling of CRLF · 65237284
    Torsten Bögershausen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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 <tboegi@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    65237284