[PR #4] [MERGED] Check out text files with LF on every platform #13

Closed
opened 2026-11-02 15:32:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mixins/pull/4
Author: @d3grando
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: gitattributes-lf


📝 Commits (1)

  • b93a2cf Check out text files with LF on every platform

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

➕ .gitattributes (+4 -0)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

Follow-up to #3, where I offered this. Git for Windows defaults to core.autocrlf=true, so a plain git clone on
Windows checks out every fixture and snapshot with CRLF. The tests compare generated output byte for byte against
tests/snapshots/*, or search fixture files for multi-line \n strings, so 7 tests fail on such a checkout for line
endings alone. This adds a .gitattributes:

* text=auto eol=lf

so text files check out with LF on every platform, whatever core.autocrlf says. text=auto still leaves binary files
alone (the repo has none today).

No committed file changes: every tracked text file is already LF in the index, and git add --renormalize . after
adding the file reports nothing to stage. The two empty fixtures (fixtures/cycle/{a,b}/src/lib.rs) stay empty.

Testing

Fresh clones made with git -c core.autocrlf=true clone on Windows 11, toolchain 1.95.0 from rust-toolchain.toml
(MSVC), cargo test --workspace --locked --no-fail-fast, each clone with its own CARGO_TARGET_DIR:

Checkout Working-tree line ends Integration tests
main (fb60016) 206 CRLF, 2 empty 54 passed, 13 failed
this branch 207 LF, 2 empty 61 passed, 6 failed

The 7 that this fixes:

  • canonical_plan_and_source_snapshots_ignore_discovery_order
  • advanced::advanced_source_and_plan_snapshots_ignore_discovery_order
  • effects::effects_snapshots_and_discovery_order_are_deterministic
  • scoped::scoped_source_plan_and_bridge_snapshots_ignore_discovery_order
  • boundary::head_preserves_lifetime_methods_closures_question_mark_and_drop
  • exact_revision_pin_is_checked
  • scoped::captures_reject_missing_shadowed_out_of_scope_and_unsupported_bindings

The 6 that still fail, on both checkouts, are Windows-only and not about line endings: the 5 listed in #3
(E_INVALID_PATH for --workspace in two tests, E_ATOMIC_STAGE in two, E_STAGE_OWNERSHIP in one). The sixth is
boundary::public_support_module_is_callable_from_a_hook_in_a_dependent_crate, added since #3, which also stops at
E_ATOMIC_STAGE ("atomic replacement of an existing stage currently requires Linux").

On Linux and macOS nothing changes: their checkouts were already LF.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-mixins/pull/4 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `gitattributes-lf` --- ### 📝 Commits (1) - [`b93a2cf`](https://github.com/horizon-rust/horizon-mixins/commit/b93a2cfda756a3c76c3a9254da47f5f92a116a0d) Check out text files with LF on every platform ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.gitattributes` (+4 -0) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Follow-up to #3, where I offered this. Git for Windows defaults to `core.autocrlf=true`, so a plain `git clone` on Windows checks out every fixture and snapshot with CRLF. The tests compare generated output byte for byte against `tests/snapshots/*`, or search fixture files for multi-line `\n` strings, so 7 tests fail on such a checkout for line endings alone. This adds a `.gitattributes`: ``` * text=auto eol=lf ``` so text files check out with LF on every platform, whatever `core.autocrlf` says. `text=auto` still leaves binary files alone (the repo has none today). No committed file changes: every tracked text file is already LF in the index, and `git add --renormalize .` after adding the file reports nothing to stage. The two empty fixtures (`fixtures/cycle/{a,b}/src/lib.rs`) stay empty. ## Testing Fresh clones made with `git -c core.autocrlf=true clone` on Windows 11, toolchain 1.95.0 from `rust-toolchain.toml` (MSVC), `cargo test --workspace --locked --no-fail-fast`, each clone with its own `CARGO_TARGET_DIR`: | Checkout | Working-tree line ends | Integration tests | | --- | --- | --- | | `main` (fb60016) | 206 CRLF, 2 empty | 54 passed, 13 failed | | this branch | 207 LF, 2 empty | 61 passed, 6 failed | The 7 that this fixes: - `canonical_plan_and_source_snapshots_ignore_discovery_order` - `advanced::advanced_source_and_plan_snapshots_ignore_discovery_order` - `effects::effects_snapshots_and_discovery_order_are_deterministic` - `scoped::scoped_source_plan_and_bridge_snapshots_ignore_discovery_order` - `boundary::head_preserves_lifetime_methods_closures_question_mark_and_drop` - `exact_revision_pin_is_checked` - `scoped::captures_reject_missing_shadowed_out_of_scope_and_unsupported_bindings` The 6 that still fail, on both checkouts, are Windows-only and not about line endings: the 5 listed in #3 (`E_INVALID_PATH` for `--workspace` in two tests, `E_ATOMIC_STAGE` in two, `E_STAGE_OWNERSHIP` in one). The sixth is `boundary::public_support_module_is_callable_from_a_hook_in_a_dependent_crate`, added since #3, which also stops at `E_ATOMIC_STAGE` ("atomic replacement of an existing stage currently requires Linux"). On Linux and macOS nothing changes: their checkouts were already LF. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:32:28 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-mixins#13
No description provided.