-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create .gitattributes #16
Conversation
To avoid the .sh file to be automatically converted to CRLF on Windows
TIL!! Thanks @binokaryg. @mrsarm - happy to grab this PR later if you don't have a Windows install handy! |
Good catch! because we are mounting the files from the host system, git messes up the end of lines chars before Docker launches the container. Thanks @binokaryg @mrjones-plip I do have dual boot in my laptop, though never used Windows with docker, if you have Docker installed please give it a try, otherwise I can try later. |
Ah - I'll leave that to you then @mrsarm. I have a Win 10 VM just like you, but also like you, no Docker. I'll be the Mac test person, you be the windows test person (and @binokaryg too if we ask nicely maybe ;) |
haha yes actually I have dual boot with Windows 10 <> Linux, but I normally use Windows only for stuff that doesn't work on Linux like our beloved IE. So maybe is better for Docker tests than a VM, I'll test it soon. |
Setting the text attribute on a path enables end-of-line normalization and marks the path as a text file. https://git-scm.com/docs/gitattributes
Hey @binokaryg , is there an special way to run projects like this in Windows? I got this error trying to run it with Docker in Windows 10 in a PowerShell session:
Searching for the error, looks like it is because the same reason this PR tries to fix: the repo is cloned and git mess the end of lines. I have cloned your repo/branch with the Github Desktop app. If I open the script file with Notepad I can see the file well, with the break lines well interpreted, so it is a signal that git did change the EOL character to match the Windows EOL, but I don't know how to avoid that, supposedly git should avoid doing that with the changes in this branch. |
That error looks similar to what I had got when I first ran it from Docker on Windows using Powershell. My docker is set up with WSL2 backend so I tried it from WSL terminal and it was working fine there. It also worked on Powershell after changing the EOL to LF, also tested with a fresh clone after adding the `*. gitattributes` file.
|
Yes my Docker installation also uses WSL 2 too, and I tried with either PowerShell and Cmd consoles. I also tried later cloning the repo with the official So you say that in order to make it works we need to use WSL instead of WSL 2? If switching from one to another solve the problem, doesn't make pointless the changes applied by the PR or does WSL configurations also require this change? Regardless of Docker and WSL, I see clearly that git is ignoring this configuration at least in my Windows setup (using 2 different git tools). But reading the git official guides your configuration seems right. @mrjones-plip would you mind give it a try? |
Sorry, I didn't mean that. The |
@mrsarm - yup yup! I tried to grab it today but first had internet outage, then turns out I know nothing about WSL2 so gotta brush up a bit ;) Stay tuned! |
Still working on this! My "Just pretend it's linux" approach didn't work. RTFM suggests I shouldn't have tried what I did, and instead their "install Docker Desktop for Windows" is best 🙄 Lemme undo what I did and restart. Having a viable WSL2 environment to test in will be worth it for my other endeavors anyway! |
Scheduling this for mid next week FYI. If there's another windows guru around to pick this up - feel free to jump on it! |
ugh - did not get to this yet :( I'll keep trying! |
I'm sorry - i haven't forgotten about this! Still trying... @mrsarm - given it works for @binokaryg and I think he's our only Windows users, is to too amateur to just merge this and then open an issue if we find a bug in it? |
Yes, just wanted to be sure is not my env only, bu for sure it is. |
To avoid the .sh file being automatically converted to CRLF when cloned in Windows