git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: A head scratcher, clone results in modified files (tested linux and cygwin) - .gitattributes file?

From
Torsten Bögershausen <tboegi@web.de>
Date
Oct 9, 2016, 10:27 UTC
Message-ID
<c9c90c24-3bf7-cd57-cad6-db28db16f323@web.de>
In-Reply-To
<7E06D61EACFB462AB96DD60720930968@black7>
On 09/10/16 08:48, Jason Pyeron wrote:
The whole .gitattributes needs to be adopted, I think
Git 2.10 or higher has "git ls-files --eol":

git ls-files --eol | grep "i/crlf.*auto" i/crlf w/crlf attr/text=auto src/site/xdoc/upgradeto2_3.xml i/crlf w/crlf attr/text=auto src/test/resources/org/apache/commons/io/FileUtilsTestDataCRLF.dat i/crlf w/crlf attr/text=auto src/test/resources/test-file-gbk.bin i/crlf w/crlf attr/text=auto src/test/resources/test-file-iso8859-1-shortlines-win-linebr.bin i/crlf w/crlf attr/text=auto src/test/resources/test-file-utf8-win-linebr.bin i/crlf w/crlf attr/text=auto src/test/resources/test-file-windows-31j.bin i/crlf w/crlf attr/text=auto src/test/resources/test-file-x-windows-949.bin i/crlf w/crlf attr/text=auto src/test/resources/test-file-x-windows-950.bin ############ Problem: xml file had been commited with CRLF : either normalize it or declare "-text".

The same is valid for the other files as well. They are identified by auto as text, and commited with CRLF. My feeling is that they should be declared as "-text". Or, to be more compatible, with "-crlf":

Solution: Make up your mind about the xml file and the html files. If they are text, they need to be normalized.

Question:
What happens, if you do this:
# Auto detect text files and perform LF normalization
*        crlf=auto

*.bin -crlf *.dat -crlf *.java crlf diff=java *.html crlf diff=html *.css crlf *.js crlf *.sql crlf

Previous: Jason PyeronNext: Jason Pyeron
Message 2 of 3 in “A head scratcher, clone results in modified files (tested linux and cygwin) - .gitattributes file?”
  1. Jason PyeronOct 9, 2016
  2. Torsten BögershausenOct 9, 2016
  3. Jason PyeronOct 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.