Skip to content

fix(templates): resolve gitattributes template generation #49078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

victorfrye
Copy link

@victorfrye victorfrye commented May 20, 2025

Summary of changes

Simple fix to the Gitattributes template so it generates the correct filename, i.e.:

.gitattrbutes => .gitattributes

Notice the addition of an i in attributes.

Verified and tested myself locally for .NET 10 fix. May need to be fixed on other in-support versions of the SDK as well?

Relevant links

Addresses #49077

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 19:58
@victorfrye victorfrye requested a review from a team as a code owner May 20, 2025 19:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the missing .gitattributes template under the Common ItemTemplates feed and corrects its filename generation for .NET SDK 10.

  • Introduces a full .gitattributes template file for text/binary attribute defaults
  • Verifies correct output filename when running dotnet new gitattributes
  • May need analogous updates for other supported SDK versions
Comments suppressed due to low confidence (2)

template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Gitattributes/.gitattributes:1

  • This new template file isn’t covered by any automated tests. Consider adding a unit or integration test to verify that dotnet new gitattributes generates the correct file contents across supported SDK versions.
## Set Git attributes for paths including line ending

template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Gitattributes/.gitattributes:23

  • [nitpick] You’ve listed both lowercase and uppercase extensions separately (e.g., *.doc and *.DOC). Since Git attribute patterns are case-insensitive by default on many platforms, consider consolidating these entries or adding a comment to explain the distinction.
*.DOC      diff=astextplain

Copy link
Member

@MiYanni MiYanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copying the text out of the HTML:

  • template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Gitattributes/.gitattrbutes
  • template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Gitattributes/.gitattributes

The problem was the i was missing from attributes. I didn't even see this at first. It wasn't mentioned in the PR description. Change looks good.

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.

2 participants