Open MattKotsenas opened 4 hours ago
Reviewers note: Please double-check my translations. These are find/replace from the .gitignore template; I don't know if anything further is required. Thanks!
For my own information - where is the diff=csharp
annotation coming from? Does git know csharp
natively? is there a list of maintained diff comparisons that the tooling knows about?
For my own information - where is the
diff=csharp
annotation coming from? Does git knowcsharp
natively? is there a list of maintained diff comparisons that the tooling knows about?
It does! I used this list: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header
This is the most up-to-date list I know of
Reviewers note: Please double-check my translations. These are find/replace from the .gitignore template; I don't know if anything further is required. Thanks!
I think we're not actually able to commit translations for new content at all - they just get overwritten by the translations that get pushed to us from the localization team via our automation. In any case, don't worry about it.
the failed tests are around commands that list all of the available template, which now includes one more. should be a quick addition.
Create a
dotnet new
template for.gitattributes
, similar to what we already have for.gitignore
and.editorconfig
. Like those files, this template provides a set of best practices and basis for customization to both get a new repo up-and-running quickly and to standardize behavior for existing repos.I started with the common template @ https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes (attribution given inline) like we do for .gitignore, then made a few changes:
1. C#-specific changes
This tells Git how to do diff hunk headers where there's a built-in pattern.
2. Handle .sln files
This follows best practice used by most repos in GitHub under the dotnet organization that specify to use
CRLF
on checkout for VS Solution files.3. Add a comment for CSV
Common.gitattributes specifies to use CRLF for CSV files but doesn't specify why. I added a comment from the commit message to clarify that it's for RFC 4180 conformance.
4. Update Scripts sections comment
The handling of line endings for shell scripts matches between Common.gitattributes and dotnet/runtime, but I used dotnet/runtime's comments because they clarify why certain line endings are needed.