Skip to content

Commit

Permalink
Disable CRLF conversion for bash scripts on repo level, removing
Browse files Browse the repository at this point in the history
requirement for global config on user machines.
  • Loading branch information
richardebeling committed Nov 21, 2023
1 parent ab41436 commit c801f10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Since text files will be used in a linux environment where LF is expected, git shouldn't change line endings to CRLF on windows machines
* text=auto eol=lf

# things that fail without this:
# * bash autocompletion (.sh): -bash: /etc/bash_completion.d/manage_autocompletion.sh: line 8: syntax error near unexpected token `$'\r''
# * running python files: /usr/bin/env: ‘python3\r’: No such file or directory
# Since that's a huge part of the code base, it doesn't really make sense to allow automatic EOL conversion for the rest of the files.
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ The easiest setup using [Vagrant](https://www.vagrantup.com) is shown here.

1. Fork the EvaP repository (using the Fork-button in the upper right corner on GitHub).

2. Windows users only (might not apply for the Linux subsystem):
* Line endings: git's [`core.autocrlf` setting](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_autocrlf) has to be `false` or `input` so git does not convert line endings on checkout, because the code will be used in a Linux VM:
2. Run the following commands on the command line to clone the repository, create the Vagrant VM and run the Django development server.
* Windows users: We have observed [weird](https://github.com/hashicorp/vagrant/issues/9143#issuecomment-401088752) [behavior](https://github.com/git-for-windows/git/issues/3657) with ssh in Git Bash on Windows and thus recommend using PowerShell instead. In theory, you should be able to use any command line tool.

```bash
git config --global core.autocrlf input
```
* We have observed [weird](https://github.com/hashicorp/vagrant/issues/9143#issuecomment-401088752) [behavior](https://github.com/git-for-windows/git/issues/3657) with ssh in Git Bash on Windows and thus recommend using PowerShell instead. In theory, you should be able to use any command line tool.
* To use Docker, replace `vagrant up` with `vagrant up --provider docker && vagrant provision`.

3. Run the following commands on the command line to clone the repository, create the Vagrant VM and run the Django development server.
To use Docker, replace `vagrant up` with `vagrant up --provider docker && vagrant provision`.
```bash
git clone --recurse-submodules https://github.com/<your_github_username>/EvaP.git
cd EvaP
Expand All @@ -38,7 +33,7 @@ The easiest setup using [Vagrant](https://www.vagrantup.com) is shown here.
./manage.py run
```

4. Open your browser at http://localhost:8000/ and login with email `[email protected]` and password `evap`.
3. Open your browser at http://localhost:8000/ and login with email `[email protected]` and password `evap`.


That's it!
Expand All @@ -63,4 +58,4 @@ MIT, see [LICENSE.md](LICENSE.md).

## Supported Browsers

The platform is only tested in Mozilla Firefox and Google Chrome. Other browsers might not render all pages correctly.
The platform is only tested in Mozilla Firefox and Google Chrome. Other browsers might not render all pages correctly.

0 comments on commit c801f10

Please sign in to comment.