Skip to content

Add .gitattributes so Windows checkouts do not corrupt the vendored bundles - #2

Merged
Protonmatter merged 1 commit into
mainfrom
fix/gitattributes-line-endings
Aug 18, 2026
Merged

Add .gitattributes so Windows checkouts do not corrupt the vendored bundles#2
Protonmatter merged 1 commit into
mainfrom
fix/gitattributes-line-endings

Conversation

@Protonmatter

Copy link
Copy Markdown
Owner

What

Adds .gitattributes to main, taken verbatim from the topic/quality-gates branch where it was written.

Why this cannot wait for #1

Cloning this repository on Windows today produces a completely broken working copy, and the cause is invisible.

support.js loads the vendored React, ReactDOM and Babel bundles with a Subresource Integrity digest, and SRI hashes exact bytes. Git's default on Windows (core.autocrlf=true) rewrites LF to CRLF on checkout, so the digests stop matching, the browser refuses to execute the bundles, and React never loads. Because the runtime hides the authored markup before booting, the result is HTTP 200, no broken links, no console error, and nothing on screen.

.gitattributes exists on topic/quality-gates (#1), but that does not help anyone cloning before it merges, and it does not help the clone itself: git clone checks out the default branch first, so main having no .gitattributes is what does the damage.

Verification

Cloning each branch with core.autocrlf=true and hashing the result:

Bundle main today with this change declared in support.js
react.production.min.js sha384-t63xaoqI4/… sha384-DGyLxAyjq0f9… sha384-DGyLxAyjq0f9…
react-dom.production.min.js sha384-8Y1L+f1y2tWR… sha384-gTGxhz21lVGY… sha384-gTGxhz21lVGY…
babel.min.js sha384-nFyaaMobkrf0… sha384-m08KidiNqLdp… sha384-m08KidiNqLdp…

Serving each clone and loading solar-system.dc.html:

  • main today: window.React undefined, 0 characters rendered
  • with this change: React 18.3.1, page renders

No renormalisation needed

The committed blobs are already pristine LF: their SHA-384 digests match the SRI constants support.js declares, and they contain zero CRLF byte pairs. This change only stops the checkout filter from touching them, so no file contents change and no git add --renormalize is required.

Merge order

Independent of #1 and safe to merge first. The file is byte-identical to the copy on topic/quality-gates, so #1 will not conflict on it.

…undles

support.js loads the vendored React, ReactDOM and Babel bundles with a
Subresource Integrity digest, and SRI hashes exact bytes. With no .gitattributes,
Git's default Windows behaviour (core.autocrlf=true) rewrites LF to CRLF on
checkout. The digests then stop matching, the browser refuses to execute the
bundles, React never loads, and because the runtime hides the authored markup
before booting, every .dc.html page renders completely blank: HTTP 200, no broken
links, no console error, nothing on screen.

The published site is unaffected. Only the Windows working copy is broken, which
makes it a genuinely confusing first experience for a contributor.

The committed blobs are already pristine LF, verified by their SHA-384 digests
matching the SRI constants support.js declares, so no renormalisation is needed.
This only stops the checkout filter from touching them.

The file is taken verbatim from the topic/quality-gates branch, where it was
written, so that the two land without conflicting.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Protonmatter
Protonmatter merged commit 9f9086c into main Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant