New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove top-level .gitignore
#757
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the discussion in #528 on generated .gitignore
files we should actually remove the toplevel .gitignore
from the fpm repository.
Yes, there is a duplication. But is it better to have a |
.mod
files in version control.gitignore
I removed the top-level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me now.
I'm actually of the opinion that a single, top-level |
What does |
Ah, you're right. It's not |
I see, it does for me as well. We might want to redesign this, and rather create a top level |
It originally was at the top level, but was moved to be in the subdirectory and always unconditionally created in the build directory when the directory is built/rebuilt to prevent problems where people were deleting or editing the .gitignore and ending up having the build directory tracked by git and copied into github repositories; and there was a possibility that fpm would allow you to change the name of the build directory to something like ".build" or a path to a writable area if say the files were owned by another user and you did not have write permission so you would not have to make a copy (adding that option did not happen so far) and so on. So if you put back the top .gitignore I would also leave the file in the build directory. Not everyone uses "fpm new" to create a project, and not everyone uses git(1). Someone changing an existing project to support fpm(1) may already have a .gitignore file, and so far "fpm new --backfill" does not change existing files. Since you know the build directory is "owned" by fpm you do not have to worry about collisions with existing files, etc. |
@urbanjost makes some good points. However, there is a point at which trying to "protect the user from themselves" has gone too far. I'm starting to think that maybe fpm should be version control system agnostic (eventually), and it should be the user's responsibility to create a |
In case we allow fpm to select the build directory it seems especially useful to have a As for other VCS repositories, like mercurial, there is |
I kind of disagree. If you have a Dealing with version control and the systems/tools used for it is (IMO) outside the scope of fpm. We chose to use git for fetching dependencies because it was expedient at the time for proof of concept and getting people using it (i.e. we didn't have to invent our own methods for location and version specification and resolution), but the end goal is that fpm users won't have to use or touch git or any other VCS except as desired for the management of their own project. Are there any other build or package management systems that interact with a VCS on behalf of their users? If so, what do they do? |
How does this work? I'm not aware of any git commands (without
|
I see. The intention is that file is created by
So other build systems do address this, but not all in the same way. If we're going to also, I guess I'm in favor of always creating it in the build folder. |
Creating build/.gitignore is part of creating the build/ directory, so even if you delete it it creates a new .gitignore in the directory to prevent some of the problems described here with deleting build/ and deleting or not having a .gitignore in the project root. I have projects that do not use git(1) for RCS. I just ignore git except when used to access remote directories. |
Creating VCS ignore files as part of generating a build directory (which is what Meson does for both VCSes it knows about) is completely free and doesn't stop people from also creating a top-level gitignore. But it does mean that users get the benefit of it even if they forgot or never thought about doing it. ... Once you're already having the build directory automatically ignore itself, why not take advantage by simplifying or potentially even getting rid of the gitignore checked into git? If the tool is smart enough to handle this for you, then you get to put in the work once, in one tool, and benefit again and again. Users then don't know anything other than "gosh, this tool is so awesome and clever, because somehow magically when I use it I never accidentally commit build artifacts to git". |
I believe that other changes have resulted in this being resolved, but not sure. Current releases of fpm create a .gitignore in the build directory if it is not present each time a build is generated; and generate no top-level .gitignore file. Is that the intent here (in which case I think this can be closed) or does VSCode need a top-level .gitignore because it generates scratch files in other locations? If so, it seems that should be addressed by VSCode (??). |
The intent here was to remove the top-level That top-level But you're correct with the Maybe I should just remove the |
Personally I think Adding it to project gitignores means that many projects get churn, and then vscode users still have issues for any projects that don't do that. |
Both options are fine for me. 🙂 |
Maybe we can resolve it this way: @gnikit, you recently added the |
Using the Modern Fortran plugin in VSCode,
.mod
files are continuously generated and I think it makes sense to exclude them from VC by adding them to.gitignore
. The.mod
files in the example folders are also excluded after the change.Fixes #758. Modifications to the template are being done in another PR.