-
Notifications
You must be signed in to change notification settings - Fork 87
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
For Unix-style line endings for scripts, add .env to .gitignore #29
For Unix-style line endings for scripts, add .env to .gitignore #29
Conversation
.gitignore
Outdated
@@ -1,2 +1,3 @@ | |||
envrc | |||
out | |||
.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing line-ending! :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave it to me to mess up a 3-line PR ;-)
@@ -0,0 +1,2 @@ | |||
# Use Unix line endings for scripts | |||
*.sh text eol=lf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this should be handled with autocrlf
on your machine right? I wonder what happens if we also set * text eol=lf
? Would git do the right thing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with autocrlf
is that it is a machine-wide setting, and I do want crlf
line endings in most of my repositories. Just not here, since these files end up getting mounted into the Vagrant VMs.
* text
would force git to treat all files in this repo as text files, which I guess is fine if you're sure you'll never check in binaries in this repo :-).
Based on my trial, it's just the .sh
files which need to lf
line endings. For example, the Dockerfile
files also end up with crlf
line endings, but docker
can handle that just fine on Linux.
I don't have a strong preference, so anything that lets me just run vagrant up
on Windows is fine with me :D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah i see. This seems fine to me then.
@qmfrederik please amend your commits to certify dco. |
Signed-off-by: Frederik Carlier <[email protected]>
Signed-off-by: Frederik Carlier <[email protected]>
…ding For Unix-style line endings for scripts, add .env to .gitignore
Description
This PR forces Unix-style checkout for
.sh
files, and adds the.env
file to.gitignore
.Why is this needed
Cloning the sandbox repository on Windows and running
vagrant up provisioner
eventually fails like this:This is because the
.sh
files are treated as text files by git, and the line endings are converted tocrlf
on Windows. Because the.sh
files are mounted into the Linux guest VMs, they would end up as with thecrlf
line ending on Linux, causingvagrant up
to fail.How Has This Been Tested?
Tested locally.
Because the scripts create symlinks in the
/vagrant
folder, you need to make sure that your Windows user has permissions to create symbolic linksHow are existing users impacted? What migration steps/scripts do we need?
Fixes a bug.
Checklist:
I have: