Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
main ▾

Modern-Apps.git / .gitattributes

.gitattributes108 lines · 3.3 KiBRaw
1# Line-ending policy for the whole repo.
2#
3# Why this file exists: the repo used to have no eol policy and `core.autocrlf=false`, so
4# whatever bytes an editor wrote were the bytes that got committed. Some files ended up stored
5# with CRLF and others with LF, sometimes in the same directory. Any tool that rewrote a file
6# wholesale then flipped every line, turning a three-line edit into a whole-file diff that
7# still built and still passed tests — so nothing caught it except review. At the worst point
8# 1329 files in the working tree differed from HEAD by line endings alone.
9#
10# `text=auto eol=lf` makes git normalise to LF in the index and check out LF everywhere, so a
11# CRLF-writing editor no longer produces a diff at all. Binary types are listed explicitly
12# rather than left to git's NUL-byte heuristic, because a false "text" guess would corrupt
13# them irreversibly.
14
15# Default: treat as text, store LF, check out LF.
16* text=auto eol=lf
17
18# ---- Shell / tooling that MUST be LF ----
19# These are executed by bash, including under WSL where CRLF gives "bad interpreter".
20*.sh text eol=lf
21gradlew text eol=lf
22
23# ---- Windows-only scripts that want CRLF ----
24*.bat text eol=crlf
25*.cmd text eol=crlf
26
27# ---- Images ----
28*.png -text
29*.jpg -text
30*.jpeg -text
31*.webp -text
32*.gif -text
33*.ico -text
34*.bmp -text
35
36# ---- Models / large binary data ----
37*.onnx -text
38*.nnue -text
39*.tflite -text
40*.pt -text
41*.bin -text
42*.dat -text
43*.db -text
44*.pmtiles -text
45# Vector tiles are protobuf, and the test fixtures are regenerated from the live archive by
46# `probe_archive`. They happen to carry a NUL early enough for git's heuristic to guess binary
47# today, but they also carry CRLF pairs, so a regenerated tile that guessed "text" would have
48# bytes stripped and fail to decode as a protobuf error rather than a corruption.
49*.mvt -text
50*.spv -text
51
52# ---- Archives / compressed ----
53*.zip -text
54*.gz -text
55*.br -text
56*.7z -text
57*.xz -text
58
59# ---- Native / JVM build output ----
60*.so -text
61*.a -text
62*.o -text
63*.jar -text
64*.aar -text
65*.apk -text
66*.aab -text
67*.dex -text
68*.class -text
69
70# ---- Fonts ----
71*.ttf -text
72*.otf -text
73*.woff -text
74*.woff2 -text
75*.eot -text
76
77# ---- Audio / video ----
78*.ogg -text
79*.mp3 -text
80*.mp4 -text
81*.wav -text
82*.flac -text
83*.m4a -text
84*.webm -text
85
86# ---- Office / documents ----
87*.pdf -text
88*.docx -text
89*.xlsx -text
90
91# ---- Keys and certificates ----
92# Certificate DER files are binary; never apply EOL (LF<->CRLF) conversion,
93# which would corrupt the bytes and break TLS trust-bundle loading.
94*.der -text
95*.jks -text
96*.keystore -text
97
98# ---- Signed test vectors ----
99# The Accrescent repodata vectors are real signify-signed files and the ed25519
100# signature covers the raw bytes, so a single LF<->CRLF conversion would make the
101# interop test fail for a reason that looks like a crypto bug.
102appstore/src/main/rust/testvectors/** -text
103
104# ---- Vendored CAD supplied by the part vendor ----
105# LCSC's STEP/WRL models are ASCII but machine-generated and never hand-edited, so they cannot
106# cause the review churn this policy exists to prevent. Excluded so they stay byte-identical to
107# what the vendor shipped — normalising them would add ~460k lines of diff for no benefit.
108things/hardware/scale/libs/lcsc/** -text