I’m contributing to an open source Rails app. I submitted a pull request to add .DS_Store to the .gitignore file. The purpose is to prevent people from accidentally adding the .DS_Store to the source code. Some people are objecting to this, saying that it’s easy to use global gitignore.
While this doesn’t directly affect me (since I use Linux instead of MacOS), I’ve made removing .DS_Store and adding .DS_Store to the .gitignore file to be a standard part of joining a Rails app. If you use my Rails Neutrino tool (https://www.railsneutrino.com/) or Generic App gem (https://www.genericapp.net/) to start a new Rails app, you start off with .DS_Store already in the .gitignore file.
Global gitignore on MacOS may be easy to use, but I still don’t understand the objection to adding .DS_Store to .gitignore. Can any of you shed some light on why people might NOT want .DS_Store listed in .gitignore? Is it really that beneficial to keep the .gitignore file as short as possible? It seems to me that it’s better to have .DS_Store in .gitignore than risk facing the annoyance of accidentally committed .DS_Store files later. Can you really count on everyone to have global gitignore set?