Skip to content

Commit a7967e5

Browse files
committed
Limit header attributes to vendored DLPack
The old attributes treated every .h and .hpp file as binary, then carved out path-specific exceptions for headers maintained in this repository. That was based on an outdated assumption that checked-in headers were broadly generated or hands-off inputs. The tracked header set is much smaller and clearer: the only header that needs Git-level byte preservation is the vendored DLPack header. Keep that file opted out of Git text normalization with -text and an explicit !eol reset, while forcing text diffs so review output stays readable. All other tracked headers now inherit the repository default text eol=lf behavior, consistent with Python files and other normal source. This includes repo-owned C++ helpers as well as the AOTI shim adaptation, which is third-party-derived but maintained here rather than a byte-for-byte vendored header. For a fresh clone, this should not change the bytes of the nine existing tracked headers on Linux or Windows. The blobs are already stored with LF line endings. On main, exception headers checked out as LF via text eol=lf while the remaining binary-classified headers were written as raw LF blob bytes. After this change, ordinary headers still check out as LF via text eol=lf, and DLPack remains raw LF. For a fresh clone, the only observable change is Git behavior: ordinary headers stop being binary-classified, and DLPack remains no-normalization but becomes text-diffable. Pre-commit behavior is unchanged and still governed by hook-specific matching.
1 parent 7a9ee61 commit a7967e5

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

.gitattributes

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
* text eol=lf
22
*.cmd text eol=crlf
33

4-
# we do not own any headers checked in, don't touch them
5-
*.h binary
6-
*.hpp binary
7-
# Exception: headers we own
8-
benchmarks/cuda_bindings/benchmarks/cpp/*.hpp -binary text diff
9-
cuda_bindings/cuda/bindings/_bindings/*.h -binary text diff
10-
cuda_bindings/cuda/bindings/_lib/*.h -binary text diff
11-
cuda_core/cuda/core/_cpp/*.h -binary text diff
12-
cuda_core/cuda/core/_cpp/*.hpp -binary text diff
4+
# Keep the vendored DLPack header byte-for-byte, but still show text diffs.
5+
cuda_core/cuda/core/_include/dlpack.h -text !eol diff
136
# git should not convert line endings in PNG files
147
*.png binary
158
*.svg binary

0 commit comments

Comments
 (0)