GithubHelp home page GithubHelp logo

Comments (6)

xparq avatar xparq commented on July 21, 2024

OK, since run_cases has no extension, .gitattributes doesn't work this way, it must be inverted to do LF by default (for *)!
Then only set .cmd to CRLF, and leave the rest as auto!

from space_test.

xparq avatar xparq commented on July 21, 2024

No, 09fca6a did nothing about run_cases, it still kept? converted? it to have CRLFs!... :-/ (As checked in a newly cloned repo.)

from space_test.

xparq avatar xparq commented on July 21, 2024

Still nothing... :-/ This is nuts. Git is so gross...

Reading https://stackoverflow.com/questions/2517190/how-do-i-force-git-to-use-lf-instead-of-crlf-under-windows/2517442
and https://stackoverflow.com/questions/55633058/why-does-git-want-to-correct-my-line-endings-to-crlf-even-though-i-want-them-to now...

And https://stackoverflow.com/questions/35801024/how-to-see-what-type-of-line-endings-are-already-in-git-repository, to check what's in the repo in the first place!

from space_test.

xparq avatar xparq commented on July 21, 2024

Wow, those idiotic "backwards" warnings about the impending LF->CRLF conversions DESPITE and AFTER setting autocrlf to false and specifically declaring the .sh files as eol=LF in .gitattributes, those are the ones that are "CRLF the most"! :D

It seems that .gitattributes did the exact opposite of what I assumed it would! :-o

git ls-files --eol

i/crlf  w/crlf  attr/                 	.gitattributes
i/lf    w/lf    attr/                 	.gitignore
i/lf    w/lf    attr/                 	README.txt
i/lf    w/crlf  attr/text             	misc/loc.sh
i/lf    w/crlf  attr/text             	test/ .cfg
i/lf    w/lf    attr/                 	test/Args.hpp
i/lf    w/lf    attr/                 	test/Makefile
i/lf    w/lf    attr/                 	test/README - SH compound commands.case/CASE
i/none  w/none  attr/                 	test/README - SH compound commands.case/Hi from the test case dir!
i/lf    w/lf    attr/                 	test/README - SH.case/case
i/lf    w/lf    attr/                 	test/README - SH.case/expect
i/lf    w/lf    attr/                 	test/README - interleaved EXPECTs control.case/case
i/lf    w/lf    attr/                 	test/README - interleaved EXPECTs control.case/expect
i/lf    w/lf    attr/                 	test/README - interleaved EXPECTs.case/case
i/lf    w/lf    attr/                 	test/README.case/case
i/lf    w/lf    attr/                 	test/README.txt
i/lf    w/lf    attr/                 	test/TC dir with no suffix/CASE
i/lf    w/lf    attr/                 	test/_engine/asset/TC-Makefile.gnumake
i/lf    w/lf    attr/                 	test/_engine/asset/TC-Makefile.nmake
i/lf    w/crlf  attr/text             	test/_engine/build.sh
i/lf    w/lf    attr/                 	test/_engine/download_file.ps1
i/lf    w/crlf  attr/text             	test/_engine/functions.sh
i/lf    w/crlf  attr/text             	test/_engine/init_once.sh
i/lf    w/crlf  attr/text             	test/_engine/init_per_case.sh
i/lf    w/crlf  attr/text             	test/_engine/run_case
i/lf    w/lf    attr/                 	test/_these are expected to fail, test them separately!/except.case
i/lf    w/lf    attr/                 	test/_todo/exename.case - fails today, was ok yesterday/CASE
i/lf    w/lf    attr/                 	test/_todo/exename.case - fails today, was ok yesterday/exename.cpp
i/lf    w/crlf  attr/text             	test/_todo/exename.case - fails today, was ok yesterday/t.sh
i/lf    w/lf    attr/                 	test/_todo/exename.case - gcc why different when run from script/CASE
i/lf    w/lf    attr/                 	test/_todo/exename.case - gcc why different when run from script/exename.cpp
i/lf    w/lf    attr/                 	test/expect file.case/CASE
i/lf    w/lf    attr/                 	test/expect file.case/EXPECT
i/lf    w/lf    attr/                 	test/expect unquoted.case
i/lf    w/lf    attr/                 	test/expect-test 1 (one-line).case
i/lf    w/lf    attr/                 	test/general.case
i/-text w/-text attr/                 	test/issue 10.case/case
i/lf    w/lf    attr/                 	test/issue 10.case/issue 10.cpp
i/lf    w/lf    attr/                 	test/long_basic.case
i/lf    w/lf    attr/                 	test/long_colon.case
i/lf    w/lf    attr/                 	test/long_multi.case
i/-text w/-text attr/                 	test/oneliner-example.case
i/lf    w/crlf  attr/text             	test/run_cases
i/lf    w/crlf  attr/text             	test/run_cases.cmd
i/lf    w/lf    attr/                 	test/short_single_no_param.case
i/lf    w/lf    attr/                 	test/subset subdir/subtree case 1.case
i/lf    w/lf    attr/                 	test/subset subdir/subtree case with build.case/CASE
i/lf    w/lf    attr/                 	test/subset subdir/subtree case with build.case/subtree case with build.cpp
i/lf    w/lf    attr/                 	test/test-demo.cpp

from space_test.

xparq avatar xparq commented on July 21, 2024

And https://git-scm.com/docs/gitattributes... It clearly says:

eol
...
Set to string value "lf"
This setting forces Git to normalize line endings to LF on checkin and prevents conversion to CRLF when the file is checked out.

from space_test.

xparq avatar xparq commented on July 21, 2024

OK, fukit, I gave in, and just set lf the default (-> also e.g. https://stackoverflow.com/a/42136008/1479945):

# So, perhaps "all LF by default" would finally convince it to forget about CRLFs:
* text=auto eol=lf

With the exceptions:

*.cmd	eol=CRLF
*.ps1	eol=CRLF

This seems to work now, finally.

from space_test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.