From a7967e5d6468cd08a3e427c64ca6f7c0135dbfad Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 21 May 2026 20:40:10 -0700 Subject: [PATCH] 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. --- .gitattributes | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index 5c4e63b373e..1e84d118156 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,8 @@ * text eol=lf *.cmd text eol=crlf -# we do not own any headers checked in, don't touch them -*.h binary -*.hpp binary -# Exception: headers we own -benchmarks/cuda_bindings/benchmarks/cpp/*.hpp -binary text diff -cuda_bindings/cuda/bindings/_bindings/*.h -binary text diff -cuda_bindings/cuda/bindings/_lib/*.h -binary text diff -cuda_core/cuda/core/_cpp/*.h -binary text diff -cuda_core/cuda/core/_cpp/*.hpp -binary text diff +# Keep the vendored DLPack header byte-for-byte, but still show text diffs. +cuda_core/cuda/core/_include/dlpack.h -text !eol diff # git should not convert line endings in PNG files *.png binary *.svg binary