Skip to content

Order the LF Conversion Before Carrying LF Files Into a CRLF-Default Repository #2290

Closed

Description

@ptr727

Observed

A resync or standup of a repository still on the old CRLF default carries files that are LF in the hub. Examples are AGENTS.md, GOVERNANCE.md, CODESTYLE.md, WORKFLOW.md, AUDIT.md, CLAUDE.md, and the .github/skills/ tree. The target's own .editorconfig still declares [*] end_of_line = crlf, so every carried file fails its editorconfig-checker run in CI. Converting each carried file to CRLF to pass the old default is churn the later LF conversion then reverts.

This came up standing up KiCadLibrary on 2026-10-02 (audit run 2026-10-02T18:58:22Z | hub bc9dc654, ptr727/KiCadLibrary#57 and ptr727/KiCadLibrary#58). The LF conversion had to go in as its own pull request ahead of the instruction set. Neither procedure says so, and docs/eol-lf-rollout.md still lists most of the fleet unconverted.

Expected

RESYNC.md section 3 and STANDUP.md sections 1A and 2 name the LF conversion as a prerequisite for a repository whose .editorconfig default is still CRLF. It lands first, as its own pull request, per docs/eol-lf-rollout.md "Per-Repo Conversion", before any carried file. That procedure's own rule, to isolate the renormalization in its own commit, also needs a merge method that keeps commits, and a develop ruleset allowing squash only collapses it. That second point is worth stating where the conversion is described.

Also seen

A repository whose vendor downloads are text-shaped needs -text pins once it takes the hub's * text=auto eol=lf, or Git normalizes them on the next add. KiCadLibrary's STEP models and DXF and SVG artwork are examples, and binary pins cover PDF and PNG. The hub's .gitattributes comment says text=auto leaves binary files byte-preserved, which holds only for files Git's heuristic calls binary. docs/eol-lf-rollout.md could say to check a repository for such files before renormalizing.

Activity

  1. ptr727 commented on Oct 3, 2026

    @ptr727
    OwnerAuthor

    A draft of this fix ran three local strict-review rounds and was withdrawn from the KiCadLibrary follow-up pull request, because every round on the new procedure prose surfaced new findings. Settle all of these in one change, not by patching one at a time. The constraints each finding placed on the wording:

    Ordering and scope

    • Name the trigger narrowly. It is a repository on the old CRLF fleet default, meaning [*] end_of_line = crlf and no registry lineEndings: crlf. An operational repository recording crlf is excepted, and docs/eol-lf-rollout.md already gives it no conversion.
    • Let the conversion carry its own config. It brings its own .editorconfig and .gitattributes, so "before any carried file" has to exempt those two files.
    • Say the conversion may come first. STANDUP 1A's "stop until the instruction set is present" needs a clause allowing the conversion pull request ahead of the carry.
    • Restate it in the skills too. .agents/skills/resync-a-repo/SKILL.md and .agents/skills/standup-a-repo/SKILL.md restate the apply order themselves, so the convert-first step belongs there as well, then scripts/build_dist.py.

    docs/eol-lf-rollout.md "Per-Repo Conversion"

    • Merge .gitattributes, never overwrite it. "Pull the hub's .gitattributes" reads as a whole-file overwrite. Several unconverted rows carry their own LFS, linguist-generated, export-ignore, or path -text attributes, so the instruction should say to merge in the hub's * text=auto eol=lf default and CRLF pins while keeping every repository-specific attribute.

    • Retire the * -text advice. The existing "confirm .gitattributes needs no change" and "What Changed" describe the old * -text file, under which git add --renormalize converts nothing.

    • Put the vendor check before renormalizing. The procedure's own sequence has to place it ahead of the renormalize step, not in a later paragraph.

    • Describe the vendor pin as a pair:

      • -text, or binary where diffs should be skipped, in .gitattributes;
      • an .editorconfig section setting charset, end_of_line, and insert_final_newline to unset and trim_trailing_whitespace to false;
      • globs written for both letter cases, such as *.[sS][tT][pP], since attribute matching is case-sensitive on a Linux clone.

      references/line-endings.md's byte-preserve recipe uses insert_final_newline = false, so the two texts should agree.

    • Name what normalizes. It is git add --renormalize, plus any add of a new file. A plain re-add of a file already committed with CRLF does not normalize.

    • Squash-only develop. The conversion pull request should carry only the renormalization and its two config files, so the squashed commit stays isolated.

    • The tick instruction contradicts itself. Line 10 says to tick the box in the converting pull request, while the per-repo text says after merge. The converting pull request is in another repository.

    Separately, most unchecked rows already set [*] end_of_line = lf, so the checklist itself is stale. Only EspDinIoT and DevKitCIoT were still crlf, and AudioCleaner sets no [*] end_of_line at all.

  2. added a commit that references this issue on Oct 4, 2026
    0b7cba3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions