chore: cleanup redundant .gitattributes files#8007
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per googleapis/librarian#4582, our
.gitattributesfiles don't need to defined on a per-package level.Analyzing all of the .gitattributes files, they appear to fall into two main catagories:
1. Package-level .gitattributes
Almost every package in the repository (both in packages/ and handwritten/) contains an identical .gitattributes file with the following content:
Note: A few files (like packages/google-cloud-tasks/.gitattributes) appeared to have 3 lines instead of 4, but this was simply due to a missing trailing newline; the content was the same.
2. .kokoro directory .gitattributes
Files located in .kokoro directories generally contain just one line:
This marks all files within the .kokoro directory as "generated" so they are ignored in GitHub language statistics and diffs.
Consolidating these into a single .gitattributes file
It seems the important bits are simply this:
Optionally, we could include the Linguist specific changes (impacting GitHubs code statistics/diffs) but I don't think its strictly necessary. For now, I have opted to ignore them.
Generator updates (going to be a separate PR to reduce toil)
I am going to update the generator, to prevent the automatic generation of .gitattributes files, in a second PR since the change is a bit more involved and doesn't require such broad set of reviewers.