Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

Remove obsolete junk from .gitignore #498

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Be-ing
Copy link
Contributor

@Be-ing Be-ing commented Aug 19, 2021

Resolves: stupid issues like https://github.com/tenacityteam/tenacity/pull/494#issuecomment-901845204

Checklist
  • I have signed off my commits using -s or Signed-off-by* (See: Contributing § DCO)
  • I made sure the code compiles on my machine
  • I made sure there are no unnecessary changes in the code*
  • I made sure the title of the PR reflects the core meaning of the issue you are solving*
  • I made sure the commit message(s) contain a description and answer the question "Why do those changes fix that particular issue?" or "Why are those changes really necessary as improvements?"*

* indicates required

Comment on lines -208 to -209
# IDEA IDEs
.idea/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have a slash in front though, for only ignoring at toplevel.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, .gitignore is for files that should be ignored for everyone working on the project. Files that are created only by your own system should be ignored for you only:

git config --global core.excludesFile '.idea'

Copy link
Member

@leio leio Aug 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, just the discoverability of this is so bad it has escaped me for over a decade as a good approach instead of listing them in project .gitignore. To the point it seems like something to note in some development docs of ours then, or we'll start getting PRs that try to add them all the time and we won't have anything to point them at as per instructions from our end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, could you make a pull request to add it to CONTRIBUTING.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot recall seeing a pull request where someone accidentally included a file generated by their editor. If that ever does happen, it is easy to catch in code review and tell the author to run git config --global core.excludesFile so I don't see what the problem is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think that this should be kept, I don't see any benefits of removing it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this here is a statement that these specific editors are preferred. I don't think that's appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But vcpkg_installed is also in the gitignore, so that means that I have to use vcpkg to install dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this here is a statement that these specific editors are preferred. I don't think that's appropriate.

On the contrary, if they were preferred, you'd let people ship relevant configurations of IDEs with them, rather than block them from doing so and "degrade" the integration with those specific IDEs, which is what we're doing here. If the .gitignore bore this sort of significance, it'd also be as if we were saying "we only prefer IDEs that leave junk in directories", which doesn't make too much sense.

Some repositories (especially the ones concerning JavaScript code, from what I've seen) leave IDE-specific directories on purpose in order to allow people to come up with a development environment instantly. This explicitly disallows people from doing so.

We could have a comment explaining that these editors are not preferred instead, maybe?

.gitignore Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
Signed-off-by: Be <be@mixxx.org>
@TheEvilSkeleton TheEvilSkeleton mentioned this pull request Aug 20, 2021
5 tasks
Copy link
Member

@n0toose n0toose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@space3375-ux
Copy link

See #498 (comment)

@n0toose
Copy link
Member

n0toose commented Aug 20, 2021

Hi, @AN7body! Welcome to GitHub! I'm not sure if there's something you wanted to say about the change, but it didn't go through, unfortunately.

*.obj
*.pyc

# Other unwanted files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire section should not be removed.

*.bsc
*.aps

# Precompiled Headers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither should this one.

*.pch
*.ncb

# Compiled Dynamic libraries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. These aren't "junk" or "outdated". They serve as extremely low-cost safe-guards against accidents. I don't know why you would ever take such a hardline approach to git ignores. They cost almost nothing to maintain, nothing to check and they prevent accidents.

*.a
*.lib

# Executables
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also useful safeguards.

# Compiled translation files (GNU Machine Object)
*.gmo

# Compiled Static libraries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, but you could get rid of the top two and just leave .a and .lib

lib-src/twolame/simplefrontend/stwolame

# Mac Specific
.DS_Store
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be left in. I believe Mac creates these automatically as hidden files to store folder attributes. Someone could literally commit this and have no idea it was even in the commit.

@@ -198,21 +12,4 @@ help/temp*
src/RevisionIdent.h
win/resetPrefs.txt

# Emacs backup files
*~
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are files automatically created by emacs in a lot of cases and if anyone has their emacs setup to generate them it's very easy to accidentally commit them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also done by some other editors too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, other editors do this too. Following your reasoning, we should add the files created by every editor out there into .gitignore... do you really think that's appropriate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I meant some editors create ~ files too.

Copy link
Member

@emabrey emabrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my other comments.

@emabrey emabrey changed the title remove obsolete junk from .gitignore Remove obsolete junk from .gitignore Aug 21, 2021
@Be-ing
Copy link
Contributor Author

Be-ing commented Aug 21, 2021

@emabrey all the build artifacts are ignored by ignoring the CMake build directory.

@emabrey
Copy link
Member

emabrey commented Aug 21, 2021

@emabrey all the build artifacts are ignored by ignoring the CMake build directory.

Someone can just go cmake -B random-build-directory and the ignores don't apply. People are only forced to build out of the root of the tree, we aren't forcing them to build in a directory named build.

@Be-ing
Copy link
Contributor Author

Be-ing commented Aug 21, 2021

If someone uses a different name for their CMake build directory, I think it's kinda silly to attempt to add every single file within that to .gitignore. I have never seen people accidentally committing entire CMake build directories be a problem in practice. Also if someone deviates from the documented build instructions, I think it's on them to know what they're doing.

@emabrey
Copy link
Member

emabrey commented Aug 21, 2021

If someone uses a different name for their CMake build directory, I think it's kinda silly to attempt to add every single file within that to .gitignore. I have never seen people accidentally committing entire CMake build directories be a problem in practice. Also if someone deviates from the documented build instructions, I think it's on them to know what they're doing.

But using the .gitignore like this is kind of already a standard practice. There are even popular websites/CLI that are literally setup to help you do it because people got tired of doing it so often:

https://www.toptal.com/developers/gitignore
https://github.com/toptal/gitignore.io
https://www.toptal.com/developers/gitignore/api/windows,macos,linux,python,cmake,c++,visualstudio,visualstudiocode,clion+all,emacs,vim,notepadpp,sublimetext,git

@Be-ing
Copy link
Contributor Author

Be-ing commented Aug 21, 2021

I have a really hard time taking something that uses a Docker container to setup a .gitignore file seriously.

@Semisol Semisol self-requested a review August 22, 2021 04:30
Copy link
Contributor

@Semisol Semisol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If you are only frustrated about the *.pc part, make it more specific)
I see this as an overall negative change, and it will probably frustrate more people by committing in files generated by their OS or editor.

PS: Feel free to remove the lib-src .gitignores from devendored dependencies

@n0toose n0toose marked this pull request as draft September 16, 2021 09:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants