gd-plug icon indicating copy to clipboard operation
gd-plug copied to clipboard

Respect .gitattributes archiving rules when copying files to match asset store releases

Open Tattomoosa opened this issue 1 year ago • 1 comments

In https://docs.godotengine.org/en/stable/community/asset_library/submitting_to_assetlib.html it's recommended to modify .gitattributes for addons submitted to the asset store to only include the addons folder, like so:

# .gitattributes

# Addon store download only includes addons folder
/**        export-ignore
/addons    !export-ignore
/addons/** !export-ignore

It should either be an optional behavior or (imo preferably) the default behavior to respect the plugin's provided archiving rules when copying files. This would fix at least one issue initially installing a repo structured in a somewhat nonstandard way (https://github.com/anthonyec/godot_little_camera_preview/tree/main - it has a separate project file stored at res://demo with its own addons folder, which adds res://demo to the project root after matching on the internal addons folder)

If it was the default behavior, it would mean that gd-plug would almost always provide the exact same release as the asset library

Tattomoosa avatar Sep 10 '24 09:09 Tattomoosa

I think this would be a great modification, since it also would make it easier for plugins to automatically exclude dev dependencies. For example, I have a Locker plugin in which I use GUT as a dev dependency. Its code is stored inside the addons folder, as conventional, inside its own subfolder (locker), like the following:

addons/
  gut/
  locker/

In this case, I don't want users to be forced to download the GUT dependency as well, since it is only used for developing, so I modified the .gitattributes to only include the addons/locker directory, which makes it so when downloading from the Asset Library the gut folder is excluded. The .gitattributes looks like this:

# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

# Only include the addons folder when downloading from the Asset Library.
/**               export-ignore
/addons           !export-ignore
/addons/locker    !export-ignore
/addons/locker/** !export-ignore

If GDPlug also used those .gitattributes rules, this plugin would automatically only have its necessary folders downloaded, without needing any explicit configurations from GDPlug users, like using the exclude argument when plugging it.

nadjiel avatar Mar 15 '25 15:03 nadjiel