Skip to content

Document CRLF/whitespace filter before staging regenerated artifacts #465

@braboj

Description

@braboj

As a contributor running a regenerate-and-commit workflow on a multi-platform project, I want documented guidance on filtering platform line-ending noise from real artifact diffs so that PRs stay scoped to genuine content changes and noise doesn't reappear as fake regressions on a different OS.

What

In a multi-platform project with a regenerate-and-commit workflow (rendered docs, generated configs, captured fixtures, snapshot artifacts), the regenerator writes files with the host platform's line endings. On Windows that's CRLF; git on commit normalizes to LF. Result: `git status` shows files as modified even when the regenerator's template produced byte-identical content semantically.

Without an explicit filter step, the PR becomes noisy (real changes buried in CRLF-only diffs) and the noise reappears on the next regeneration on a different OS, looking like a regression.

Concrete pattern to document:

```bash

After running the regenerator:

git status --short # see all modifications
git diff --ignore-all-space # zero output = CRLF-only / pure whitespace
git checkout -- # drop the noise before staging
```

Why

Observed in me-fuji session 146 (chart-quality refresh workflow): `git status` showed 9 modifications + 2 untracked files. `git diff --ignore-all-space` revealed 7 of the 9 modifications were pure CRLF normalization. The real change set was 4 artifacts. Without the filter step, the PR would have been 11 files; the actual commit was 4.

Acceptance criteria

  • Section added to one of: `base/git.md` (regenerate-and-commit subsection), `base/workflow/ai-workflow.md` Lessons Learned, or new subsection
  • Concrete commands shown (`git diff --ignore-all-space`, `git checkout --`)
  • Acknowledges that this applies to any regenerated artifact workflow, not just docs

Where it could live

  • `base/git.md` §"Regenerate-and-commit hygiene" (new subsection)
  • `base/workflow/ai-workflow.md` §"Lessons Learned" (as a process pattern)
  • `base/core/quality.md` near the `.editorconfig` recommendation

Flagged from me-fuji session 146 wrap. Same project also added a sibling lesson (visual spot-check on regenerated binary artifacts) — filed separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — nice to havetaskAtomic implementable work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions