[Maria-developers] Windows line endings in MariaDB sources again (

Hello! While trying to release 10.0.26 for Debian and Ubuntu I noticed git chokes again on Windows line endings. As our .gitattributes states that by default git should clean up the line endings, why do we keep getting new Windows line endings in new code? mariadb-10.0$ cat .gitattributes # Set the default behavior, in case people don't have core.autocrlf set. * text=auto ... storage/connect/mysql-test/connect/std_data/*.txt -text mariadb-10.0.26$ find . | xargs file | grep CRLF ./storage/connect/mysql-test/connect/std_data/boyswin.txt: ASCII text, with CRLF line terminators ./storage/connect/mysql-test/connect/std_data/expenses.txt: ASCII text, with CRLF line terminators ./storage/connect/mysql-test/connect/std_data/emp.txt: ASCII text, with CRLF line terminators ./mysql-test/std_data/loaddata7.dat: ASCII text, with CRLF line terminators ./mysql-test/r/loadxml.result: ASCII text, with CRLF, LF line terminators ./mysql-test/r/perror-win.result: ASCII text, with CRLF, LF line terminators ./mysql-test/r/mysql_binary_mode.result: ASCII English text, with CRLF, LF line terminators ./mysql-test/r/func_regexp_pcre.result: UTF-8 Unicode C++ program text, with CRLF, CR, LF line terminators ./pcre/testdata/grepoutputN: ASCII text, with CRLF, CR, LF line terminators ./pcre/testdata/greppatN4: ASCII text, with CRLF line terminators This leads for me to: dpkg-source: info: building mariadb-10.0 using existing ./mariadb-10.0_10.0.26.orig.tar.gz dpkg-source: info: local changes detected, the modified files are: mariadb-10.0/storage/connect/mysql-test/connect/std_data/boyswin.txt mariadb-10.0/storage/connect/mysql-test/connect/std_data/emp.txt mariadb-10.0/storage/connect/mysql-test/connect/std_data/expenses.txt dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/mariadb-10.0_10.0.26-1.diff.Yzwwhw Which means I have to do extra work with importing the upstream sources.. - Otto

Hi, Otto! On Jun 24, Otto Kekäläinen wrote:
Precisely. This line means that git should do NOT convert line endings for *.txt file under storage/connect/mysql-test/connect/std_data.
And it does not, as instructed. Looks correct to me.
*.result -text -whitespace
./mysql-test/std_data/loaddata7.dat: ASCII text, with CRLF line terminators ^^^^^
This, by the following: *.dat -text -whitespace
./pcre/testdata/grepoutputN: ASCII text, with CRLF, CR, LF line terminators ./pcre/testdata/greppatN4: ASCII text, with CRLF line terminators
The first one, strangely enough, is not in .gitattributes, the second is: pcre/testdata/greppatN4 -text In short, everything is correct. Git was explictly told not to convert those files, and it doesn't do that.
Sorry, I don't follow. How does the first (CRLF in specific files) cause the second (your dpkg-source error) ? Regards, Sergei Chief Architect MariaDB and security@mariadb.org

2016-06-24 18:58 GMT+03:00 Sergei Golubchik <serg@mariadb.org>:
Somehow, despite the current .gitattributes, the std_data file line endings get converted by git during import/merge and the resulting repository CRLF files are only these: ./mysql-test/std_data/loaddata7.dat: ASCII text, with CRLF line terminators ./mysql-test/r/loadxml.result: ASCII text, with CRLF, LF line terminators ./mysql-test/r/perror-win.result: ASCII text, with CRLF, LF line terminators ./mysql-test/r/mysql_binary_mode.result: ASCII English text, with CRLF, LF line terminators ./mysql-test/r/func_regexp_pcre.result: UTF-8 Unicode C++ program text, with CRLF, CR, LF line terminators ./pcre/testdata/grepoutputN: ASCII text, with CRLF, CR, LF line terminators ./pcre/testdata/greppatN4: ASCII text, with CRLF line terminators To get git not to change the line endings I defined in .git/info/attributes *.* binary * binary But this was just a temporary fix of course. Only the files girls.txt was touched in 10.0.26, I didn't figure out why git wanted to import/update those other files. However, 10.0.26 introduced a storage/connect/.gitattributes file, maybe it lead to this situation. It declares like this: +# Declare files that will always have LF line endings on checkout. +*.result text eol=lf +mysql-test/connect/std_data/*.txt text eol=lf +mysql-test/connect/std_data/*.dat text eol=lf Apparently connect developers what those files to have unix line endings, maybe we should follow suite.

Hi, Otto! On Jun 24, Otto Kekäläinen wrote:
It just happened that these files have CRLF lines inside, while other *.result files have only LF lines. Git did not convert anything.
-text means "not to change the line endings". binary means "-diff -merge -text", that is "do not do diffs on the file, do not try to merge them, do not change line endings". For result files, it's an overkill, -text is sufficient.
Hmm. I thought that git only looks at top-level .gitattributes, so the second one is ignored. But If git also considers .gitattributes from subdirectories, I'll need to take a look at that second .gitattributes. Regards, Sergei Chief Architect MariaDB and security@mariadb.org

Hello! While importing MariaDB 10.4 into Debian I noticed this has happened again, now with the extras/wolfssl directory. To get git not to change the line endings I defined temporarily in .git/info/attributes *.* binary * binary pe 24. kesäk. 2016 klo 15.06 Otto Kekäläinen (otto@seravo.fi) kirjoitti:
-- Otto Kekäläinen CEO Seravo +358 44 566 2204 Follow me at @ottokekalainen
participants (2)
-
Otto Kekäläinen
-
Sergei Golubchik