Skip to content

Every build rewrites .gitattributes and deletes the patch-*.txt -text rule protecting the CRLF patch fixtures #132

Description

@matt-edmondson

What's wrong

Commit 50fe58b added a repository-specific rule to the root .gitattributes:

GitIntegration.Test/Fixtures/patch-*.txt -text

The rule is there because patch-crlf.txt deliberately mixes LF and CRLF line endings. Without it, the global * text=auto eol=lf would normalize that file.

ktsu.Sdk 2.25.0 has a target, _KtsuSyncStyleConfigFiles in Sdk.targets, that runs before PrepareForBuild. It copies the SDK's shared gitattributes over $(SolutionDir)/.gitattributes, and that removes the block above.

Failure scenario

  1. Run a plain dotnet test.
  2. git status now shows M .gitattributes, and the diff is exactly the deletion of that block.
  3. Every contributor's build dirties the tree in the same way. The first git add -A or git commit -a commits the deletion without anyone noticing.
  4. From then on, any touch or renormalize of patch-crlf.txt strips its CRs. The CR-preservation parser test then either fails, or quietly stops testing what it was written to test.

Suggested fix / acceptance criteria

  • Move the exemption into a nested file, GitIntegration.Test/Fixtures/.gitattributes, containing patch-*.txt -text, and remove the block from the root file.
    • Git honours nested attribute files, and the SDK sync only touches the solution-root file, so the rule survives builds.
  • Acceptance:
    • After dotnet build, git status is clean.
    • git check-attr text GitIntegration.Test/Fixtures/patch-crlf.txt reports unset.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions