Skip to content

[patch] Keep the patch-fixture -text rule out of the SDK-managed root .gitattributes - #134

Merged
matt-edmondson merged 1 commit into
mainfrom
claude/gitintegration-132-fixture-gitattributes
Sep 28, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
claude/gitintegration-132-fixture-gitattributes

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #132

Problem

ktsu.Sdk's _KtsuSyncStyleConfigFiles target regenerates the root .gitattributes on every build. That deletes the GitIntegration.Test/Fixtures/patch-*.txt -text rule protecting the mixed LF/CRLF patch fixtures. After any dotnet build the tree is dirty, and the deletion is easy to commit by accident.

Change

  • Moved the rule into a new GitIntegration.Test/Fixtures/.gitattributes as patch-*.txt -text, with a comment explaining why it lives there.
  • The root .gitattributes is now exactly what the SDK writes, so building leaves it unchanged.

Verification

Checked against the acceptance criteria in the issue:

  • Before: on main, dotnet build removes the rule. git check-attr text GitIntegration.Test/Fixtures/patch-crlf.txt then reports auto.
  • After: on this branch, dotnet build leaves git status clean. git check-attr text reports unset for patch-crlf.txt and patch-new-file.txt, and other fixtures such as github-pullrequests.json stay auto.
  • git add --renormalize . changes nothing.
  • The patch tests pass: 37 of 37.

No unit test was added. The failure is in repository attributes, not in code, so the git check-attr check above is the regression check.

Separately, the SDK overwriting repository-specific attributes may deserve its own issue in ktsu-dev/Sdk, as the triage comment suggests. This PR does not address that.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P1dENrzXtWG4vP7thSjyof


Generated by Claude Code

… .gitattributes

ktsu.Sdk regenerates the root .gitattributes on every build, which
deleted the "GitIntegration.Test/Fixtures/patch-*.txt -text" rule and
left the tree dirty after any dotnet build. Move the rule into
GitIntegration.Test/Fixtures/.gitattributes, where the SDK does not
touch it, and take the root file in the form the SDK writes.

Fixes #132

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1dENrzXtWG4vP7thSjyof
@sonarqubecloud

Copy link
Copy Markdown

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.

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

2 participants