Compare commits

..

4 Commits

2 changed files with 60 additions and 20 deletions

79
.gitattributes vendored
View File

@ -1,29 +1,68 @@
# See https://www.git-scm.com/docs/gitattributes#_effects for more information # If file is text, use lf line-endings and let forges show it in repo
# languages. For more information: `man gitattributes`
* text=auto eol=lf linguist-detectable * text=auto eol=lf linguist-detectable
# Hunk headers for diff shipped with git # Suggestions for inevitably encountering .gitattributeless repositories when
# .gitattributes cannot be added:
# git config --global core.autocrlf input
# - `* text=auto` when there is no `.gitattributes`. In other words,
# commit eol=lf, check-out as it is.
# git config --global core.safecrlf warn
# - Warn if EOL change is irreversible.
# git config --global merge.renormalize true
# - Avoid merge-conflict when merging from .gitattributeless branch to
# .gitattributed branch
# Built-in diff patterns (disabled by default). The attribute `diff` implies
# `text` and the above attributes are inherited.
# https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header # https://www.git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header
*.{sh,bash,zsh} text diff=bash eol=lf # TODO
*.bibtex text diff=bibtex eol=lf # diff=matlab
*.cpp text diff=cpp eol=lf # diff=pascal
*.css text diff=css eol=lf *.{adb,ads} diff=ada
*.go text diff=golang eol=lf *.bibtex diff=bibtex
*.html text diff=html eol=lf *.cs diff=csharp
*.java text diff=java eol=lf *.{c,cpp} diff=cpp
*.{md,markdown} text diff=markdown eol=lf *.css diff=css
*.pl text diff=perl eol=lf *.dts diff=dts
*.php text diff=php eol=lf *.{ex,exs} diff=elixir
*.py text diff=python eol=lf *.{f90,f,for} diff=fortran
*.rb text diff=ruby eol=lf *.fountain diff=fountain
*.tex text diff=tex eol=lf *.go diff=golang
*.html diff=html
*.java diff=java
*.{kt,kts} diff=kotlin
*.{h,m,mm,M} diff=objc
*.pl diff=perl
*.php diff=php
*.py diff=python
*.rb diff=ruby
*.{rs,rlib} diff=rust
*.{scm,ss} diff=scheme
*.tex diff=tex
# These files are scary, let's not touch them # bash & co aren't often Windows, so alway have lf line-endings regarldess
# Lockable is provided by git-lfs # of the above. Markdown is also included as I utilise doctoc, which
LICENSE text lockable # requires lf line-endings.
CITATION.cff text lockable *.{sh,bash,zsh} diff=bash eol=lf
*.{md,markdown} diff=markdown eol=lf
# Windows files even in checkout # While this file is like .gitignore, negative patterns are forbidden and
# directory/ wouldn't recurse, thus directory/**. Also !attribute would set
# it back to unset.
# In this case Windows/** may also contain binary files, thus auto-detection
# is repeated and eol=crlf as it's unlikely to be of use outside of Windows.
Windows/** text=auto eol=crlf
# Similarly these files are unlikely to be encountered outside of Windows.
# The "text" attribute is used as otherwise they rely on auto-detection of
# textness since there is no diff attribute set.
# Ref: https://rehansaeed.com/gitattributes-best-practices/#line-endings # Ref: https://rehansaeed.com/gitattributes-best-practices/#line-endings
*.{reg,[rR][eE][gG]} text eol=crlf *.{reg,[rR][eE][gG]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf *.{bat,[bB][aA][tT]} text eol=crlf
*.{ahk,[aA][hH][kK]} text eol=crlf *.{ahk,[aA][hH][kK]} text eol=crlf
# These files are scary, let's not touch them. The attribute "lockable" is
# provided by git-lfs. https://github.com/git-lfs/git-lfs/wiki/File-Locking
LICENSE text lockable
CITATION.cff text lockable

View File

@ -1 +1,2 @@
* text=auto eol=crlf * text=auto eol=crlf
*.{md,markdown} text eol=lf