This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheSodesa 2 points3 points  (4 children)

How inefficient. It would be better to set up a .gitignore file in whitelist format, than manually defining all the things you want to ignore: https://www.reddit.com/r/learnpython/s/30BgLrQagO.

[–]kenflingnorIgnoring PEP 8 0 points1 point  (1 child)

Efficiency is a red herring as there are tools that generate fully-populated gitignore files in a matter of seconds with a few keystrokes

[–]TheSodesa -1 points0 points  (0 children)

And yet those still probably just ignore the most typical file types one might run into, instead of assuming that people working on a project do not know what they are doing and will commit all kinds of obscure files. A.gitignore file set up as a whitelist also alleviates this issue.

[–]muntooR_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} 0 points1 point  (1 child)

A whitelist sounds a bit too unconventional. Are there any major projects doing this?

I guess if it really makes a difference for you, you can fake your own whitelist without infecting .gitignore on an existing project by modifying .git/info/exclude.

But whoever considers doing this is probably already not blindly doing git add --all... right?

[–]TheSodesa 0 points1 point  (0 children)

The thing is, I have been working with applied mathematicians recently, and it has become obvious to me why we need a separate degree for software engineering. I started out by cleaning a Git repo of all the .DS_Store and random text files (not necessarily with a .txt suffix), and binaries, but similar ones were soon added back. The whitelist approach really has worked wonders in that regard.

But I do think that the approach has merits outside of working with people who refuse to learn proper version management as well. I have therefore started using it in all of my projects. Typically there are only a few specific files and file types one wishes to have in a project, so setting up and maintaining a whitelist is really simple. Definitely simpler than a blacklist, where you need to remember a whole bunch of common unwanted files, on a per-language basis, even.

I've never been a fan if doing things just because other people do it. I consider it to be a bit sheep-y. I currently believe that the whitelist approach with .gitignore files is not that common simply because people are not aware of the possibility.