Skip to content
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

Merged
merged 2 commits into from
Apr 30, 2021
Merged

Create .gitattributes #16

merged 2 commits into from
Apr 30, 2021

Conversation

binokaryg
Copy link
Member

To avoid the .sh file being automatically converted to CRLF when cloned in Windows

To avoid the .sh file to be automatically converted to CRLF on Windows
@mrjones-plip
Copy link
Contributor

TIL!! Thanks @binokaryg.

@mrsarm - happy to grab this PR later if you don't have a Windows install handy!

@mrsarm
Copy link
Contributor

mrsarm commented Apr 7, 2021

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.

@mrjones-plip
Copy link
Contributor

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 ;)

@mrsarm
Copy link
Contributor

mrsarm commented Apr 7, 2021

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
@mrsarm
Copy link
Contributor

mrsarm commented Apr 9, 2021

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:

> docker-compose up
Creating nginx-local-ip ... done
Attaching to nginx-local-ip
nginx-local-ip    | standard_init_linux.go:219: exec user process caused: no such file or directory
nginx-local-ip exited with code 1

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.

@binokaryg
Copy link
Member Author

binokaryg commented Apr 9, 2021 via email

@mrsarm
Copy link
Contributor

mrsarm commented Apr 12, 2021

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 git command for Windows instead of the GitHub Desktop app, but got the same.

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?

@binokaryg
Copy link
Member Author

binokaryg commented Apr 13, 2021

So you say that in order to make it works we need to use WSL instead of WSL 2?

Sorry, I didn't mean that. The WSL Terminal I used was in fact WSL2.

@mrjones-plip
Copy link
Contributor

@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!

@mrjones-plip
Copy link
Contributor

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!

@mrjones-plip
Copy link
Contributor

Scheduling this for mid next week FYI. If there's another windows guru around to pick this up - feel free to jump on it!

@mrjones-plip
Copy link
Contributor

ugh - did not get to this yet :( I'll keep trying!

@mrjones-plip
Copy link
Contributor

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?

@mrsarm
Copy link
Contributor

mrsarm commented Apr 30, 2021

Yes, just wanted to be sure is not my env only, bu for sure it is.

@mrsarm mrsarm merged commit 4772c05 into medic:main Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants