godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.4k stars 19.24k forks source link

`.gitignore` written by the editor's Version Control Metadata functionality is incomplete #93026

Open mubinulhaque opened 3 weeks ago

mubinulhaque commented 3 weeks ago

Tested versions

System information

Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1650 SUPER (NVIDIA; 31.0.15.5152) - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 Threads)

Issue description

.gitignore doesn't include the same number of files that the official gitignore repository has. For comparison, creating a project with Version Control Metadata set to Git will contain the following .gitignore:

# Godot 4+ specific ignores
godot/

Meanwhile, the official Godot .gitignore found here is:

# Godot 4+ specific ignores
.godot/

# Godot-specific ignores
.import/
export.cfg
export_presets.cfg

# Imported translations (automatically generated from CSV files)
*.translation

# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json

Note that the above quote is strangely formatted due to GitHub. Please click the link above to see what it should actually look like.

The official one should be the one created with Godot.

Steps to reproduce

  1. Create a new project with the Godot Project Manager
  2. Set Version Control Metadata to Git

Minimal reproduction project (MRP)

Not necessary. Any project created with version control metadata set to Git will contain the incomplete .gitignore file.

akien-mga commented 3 weeks ago

https://github.com/github/gitignore/blob/main/Godot.gitignore covers Godot 2, Godot 3 and Godot 4, while the .gitignore file generated by Godot 4 for a Godot 4 project doesn't need to keep listing Godot 3 specific files.

export_presets.cfg is up for debate - it used to be ignored in Godot 3 due to include things like Android export credentials, but that's no longer a problem in Godot 4, so the file doesn't need to be ignored (not having it in Git means you can't export the project from CI).

*.translation files IMO shouldn't be ignored, but that's something worthy of more investigation.

Calinou commented 3 weeks ago

*.translation files IMO shouldn't be ignored, but that's something worthy of more investigation.

These files are binary files generated from the source CSV files, so there shouldn't be any reason to commit them to version control. gettext PO files also have binary MO counterparts, but these need to be committed to version control as these files must be manually generated by the user.

To be fair, *.translation files should probably be written to .godot/ and the TranslationServer's list of translations should refer to the source CSV files instead of directly referring to the imported files.