by pilif · 3y ago · 0 comments
People working on Linux or Windows do not need to know about garbage your dev env leaves on your machine.
I’m saying this half-seriously as I fully understand that these are so common, it’s more convenient to have the exclusion synced between clones.
That said, as a purist, none of the repos I’m watching over have .DS_Store in their gitignore
> Patterns which should be version-controlled and distributed to other repositories via clone (i.e., files that all developers will want to ignore) should go into a .gitignore file.
and
> Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user’s workflow) should go into the $GIT_DIR/info/exclude file.
To me it seems obvious that all developers would want to ignore .DS_Store even if only some of them would generate it. And certainly you want it distributed to other mac users when they clone. Further, it's certainly not the case that .DS_Store is specific to just one user's workflow. On all three cases therefore gitignore would be reasonably appropriate.
I understand the pollution concern… but unless that .git/info/exclude is standard in the company, what prevents a intern to not have a correct exclusion there, and happily push a .ds file ?
.gitignore looks more robust to the obvious user. And it’s not like it’s a file you need to look at attentively every day.
But yes, I do see that you are correct!
Our CI.
And code review is what prevents .DS_Store to be added to .gitignore.
And, again, I'm saying this as a purist with a developer team of 99% Mac users.
Just like we have CI checks to make sure nobody accidentally commits a secret (like the GitHub host key thing last week) we have checks that prevent debris to be committed and code to be formatted according to agreed-upon coding standards.
All of this might seem superfluous when the live expectancy of a repo is measured in months or single digit years, but then, no solution or repo is more permanent than a quick throw-away one.
Which is why this isn't even a discussion but just a reality. Been there, done that, learned my learnings.
I've seen all kinds of filters in a .gitignore for programs I don't personally use. I don't mind it at all.