-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Allow creating .gitignore and .gitattributes when creating a new project #42447
Conversation
AFAIK, it's a bit strange to require
|
I'm opposed to having possibly useless files as a default in each single project directory, no matter the size. On the other hand, the majority probably uses git anyway or doesn't care that much about some clutter. But still, Godot is open to be used with different VCS and I find it bothersome of an application to assume for me, what I might need. I'd rather like to see this as a part of an optional "project template" setup to pre-create most common project structures with VCS integration or not. |
I'm in favor of this, since these files will be hidden by default on macOS and Linux. On Windows, we might be able to set the "hidden" attribute ourselves in the future. While it is possible to use other version control systems with Godot, the overwhelming majority of users I know of use Git. This goes from gamejam developers to medium-sized indie studios 🙂 |
I have a Python package On the other hand, we have plugins like https://github.com/godotengine/godot-git-plugin semi-officially maintained:
Godot seems to have the API for implementing various VCS providers. So Godot can decide to officially support
Semi-related proposal: godotengine/godot-proposals#1481. I mean, this could be potentially made configurable via the project manager checkboxes:
|
@timothyqiu As discussed here, it's best to use LF everywhere with Godot. @artism90 I forgot to mention that it is extremely trivial to delete these files if you don't want them. |
I agree. There should be a possibility to initiate an actual Git repo with those files (like e.g. |
Maybe there should be a checkbox in editor settings for this? Also, this reminds me, it would be nice if there was a way to access editor settings in the project manager. |
I think what config Godot uses and what config a godot project uses are two different things. Unlike line endings in the repository, using CRLF line ending in the working directory won't cause any trouble. It's just a matter of the repository owner's taste. The Godot team is Linux native. It's reasonable for the team to choose forcing LF everywhere to minimize the trouble in its own repository, even though the choice is kind of an anti-pattern, allowing to copy the directory directly between Linux and Windows instead of using Git to fetch the source code. Rust also uses |
d80e3b4
to
2841614
Compare
I updated this PR so that these files are now optional, and it's easy to disable their creation With everything disabled, an empty project only has |
2841614
to
b4f4415
Compare
I discussed this with some people on Discord and it seems that there are indeed some people who would find this annoying, so I changed this PR to have these new settings disabled by default. In the future if it's decided that we should have this setting enabled by default, it would be easy to make a follow-up PR for that, but in the meantime this PR in its current state can only benefit people since the default behavior is the same. |
I am really happy about this PR, but I would like to argue against having it Off by default. It doesn't matter if there are some people who find it annoying, the majority of people use git for version control, and it makes more sense to provide sensible defaults that cater to most users, not the outliers. Are there other scenarios reasons against a .gitignore file? (Other than "we don't use git for version control") Also note that the Cocos Creator engine (widely popular) also provides a .gitignore by default on project creation, so there is precedent. |
b4f4415
to
5106f6a
Compare
It is not sensible, though, that this option is hidden in the editor settings, in an unrelated to VCS section. This should be a project creation step with an optional editor top menu item to recreate those files after the initial project creation if they have been omitted (or if it is an existing project). Which VCS somebody uses is very situational and personal thing, and just because there is a trend in OSS community doesn’t mean we should make this harder to configure. More than that, this setting may vary per project inside of the same team. So unless this is an option like “Create git repository” available at project creation, then this is an unwelcome change. With a room to introduce other popular VCSs later, of course. The default state can be made configurable in the editor settings, if needs be. |
@pycbouh I'm fine with making it an option during project creation (and remembering the choice per-user locally for future projects). As long as I can make it init git by default I don't really care how visible the option is. |
@pycbouh Adding these options absolutely does not make any VCS system harder to configure. With non-Git VCS systems, even if these checkboxes were enabled by default, the files are harmless and super easy to delete. I disagree that this change is unwelcome if there isn't also a way to initialize a Git repository, I think these are separate issues. I made this PR to try and solve real world problems people have, where people put a Godot project on GitHub and they are missing these important files. On the other hand, it is impossible for people to put a project in a GitHub repository without a Git repository, so people needing Godot to create a Git repository is not the real world problem I'm trying to solve with this PR, and is a separate issue. |
@aaronfranke You've misunderstood me completely... My point was about making this new addition configurable at the project creation screen instead of hiding it somewhere in the editor settings, and in a section that has nothing to do with VCS at that. It was suggested by 3 other people before me that we should be able to tick this as we are making a new project, and putting this setting into a menu inaccessible unless you open a project is making it harder to configure than it needs to be. I am not against adding these options, if you make them easy to disable for a particular project. Which is why I suggest adding a toggle saying something like "Create/Initialize git repository" to the project creation window, as well as adding this as an action to the top editor menu (say, below the "Project" item) so people can initialize the repository for existing projects as well. And of course this should be implemented in a way that would allow adding other VCSs in the future. So it's not so much "Init git" but "Init a VCS" with git as the only currently available option. Also that option as well as whether or not do it by default at all should be remembered and configured for future projects as asheraryam says. And I wasn't saying that we must initialize the repo for this PR to be welcome. I wasn't making any distinctions between simply creating those two files and fully initializing the repo. If you'd like to just create two files in the first iteration of this, do that. I was saying that this PR is in my opinion unwelcome if you don't provide an option to prevent this action from happening from the project creation screen, that's it. |
@pycbouh |
First of all, everything Git related should be under one checkbox here. There is almost no need for such granularity as you describe. In fact it's that granularity that can be put into the editor settings, but the action should be toggled from the creation screen with just one checkbox. And when we add more VCSs, it will be just a drop list alongside that checkbox. Secondly, no need fear-mongering with the slippery slope, we are fully capable of making a judgement on what settings should or shouldn't go there. They can even exist in a collapsible section, so that they don't take space unless you know you want to configure them. Ultimately, this is a setting that differs for each individual project, it makes sense to decide on it the moment you create them, not fiddle with the whole set of editor settings just to create a single project. That's an unnecessarily complicated way to handle a forced feature that has nothing to do with Godot. It's very presumptuous to assume that because a lot of people use Git, others must be inconvenienced and required to seek out a hidden setting or to remove files afterwards. I don't want to say that there are bad intentions, but many comments here assume that it's an okay approach because it aligns with their behavior when using this software. I don't think that ignoring the needs of so called "some people" is a correct way to handle this feature. |
5106f6a
to
f51763c
Compare
abd983b
to
99189d9
Compare
99189d9
to
6f7db5c
Compare
6f7db5c
to
989b67a
Compare
989b67a
to
1f6a314
Compare
One of the reasons why https://github.com/godotengine/godot-git-plugin was made into a different plugin was that the editor was supposed to be kept as VCS agnostic as possible. However, it is true that most users use Git, so the initial implementation of the VCS interface was done for Git. The Git plugin actually takes care of creating a So should this functionality just be implemented by the VCS interface implementations (plugins) or is it fine if the editor implements the same thing again? Because using Git specific terms in the plugin implementation is expected but using them in the editor break that kind of VCS agnosticism built in it. |
@ChronicallySerious If you take a closer look, there is a dropdown menu that allows selecting either Git or None. Any other metadata files for other version control systems can easily be added. However, I haven't used anything other than Git. Someone who uses Git with Godot may use a separate client and therefore not want full blown support in the editor, but they still need these metadata files, and it can't be expected that third-party clients create them. This means that either Godot does it, or users have to hunt them down manually, or they forget. Another possibility is that users start with command-line Git and only install the Godot Git plugin later. In which case, it's too late for the plugin to create these files - some gitignored files may have already been committed and have to be deleted manually. |
28d70a7
to
12616fc
Compare
8803cae
to
d48bfa9
Compare
d48bfa9
to
a97d5ef
Compare
What is the resolution on this one? do we have full consensus to merge? Also devault_env.tres and related should be removed, it's no longer needed in Godot 4. |
@reduz Some people are against it but most are in favor. As for removing EDIT: No, |
e6b73db
to
d33044e
Compare
With the preview sun and sky system, this is meant to be resolved differently. For example, we could print a warning message by scanning the scene tree for the lack of WorldEnvironment node in debug builds (only if there's at least 1 Node3D in the scene). The same can be done for the lack of a Camera3D node. |
d33044e
to
7657c38
Compare
7657c38
to
43e0bca
Compare
Also allow creating these files later, and also allow disabling creating the default environment in editor settings.
43e0bca
to
ed9c7bf
Compare
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.
Approved in PR review meeting.
Thanks! |
Implements and closes godotengine/godot-proposals#1813.
Many people either forget to make
.gitignore
files, or make them incorrectly, or make them correctly but not until after they committed files that shouldn't be committed. There was also some concern about possible confusion with the.godot/
folder. We can solve all of these problems by having Godot automatically create a.gitignore
file.This PR also has Godot automatically create a
.gitattributes
file. It's a subset of the one in the main repo. This doesn't include any manual definitions for binary files, but I think it's safe to assume Git >2.10 now (2.11 came out in 2016).For people who aren't using Git, these files are useless, but also they are harmless and extremely small (total 116 bytes), and there is a dropdown menu where you can disable their creation. In the future, this dropdown menu could be expanded to have more types of metadata for different version control systems.
Note: This gitignore doesn't include
.translation
, so this PR expects that #42392 will be merged (but the PRs shouldn't conflict).This can be cherry-picked to 3.x if desired, but we will have to include the rest of the 3.x ignores too.
EDIT: The files are now optional, they can be disabled in the project creation dialog: