Skip to content

Commit

Permalink
use LF for all text files (#606)
Browse files Browse the repository at this point in the history
Julia writes newlines as LF. Before we had to specify files written by
Julia in the .gitattributes. But it is easier to just set this as the
default for all text files. There is no real advantage to using CRLF
since the tools we use can handle both.

Another advantage is that this is independent of global settings that
can be different for different users.

For reference, I now decided to go for these global settings, useful for
(especially Julia) repos without .gitattributes.

```
[core]
eol = lf
autocrlf = input
```

The `autocrlf = input` converts CRLF to LF when committing, but not vice
versa when checking out.

Also I set my VS Code settings to create new files with LF by default.
To do that for Julia only, you can

```
    "[julia]": {
        "files.eol": "\n",
    },
```
  • Loading branch information
visr authored Sep 18, 2023
1 parent a464bff commit ccd505b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
* text=auto

**/Project.toml eol=lf
**/Manifest.toml eol=lf
**/*.json eol=lf
* text=auto eol=lf

0 comments on commit ccd505b

Please sign in to comment.