Skip to content

Update Unity gitattributes#194

Merged
alexkaratarakis merged 14 commits into
gitattributes:masterfrom
FurkanKambay:unity
Jul 31, 2023
Merged

Update Unity gitattributes#194
alexkaratarakis merged 14 commits into
gitattributes:masterfrom
FurkanKambay:unity

Conversation

@FurkanKambay
Copy link
Copy Markdown
Contributor

@FurkanKambay FurkanKambay commented Jul 28, 2023

The Unity file needed some love.

  • Combined some largely reused effects in a macro so it's much more concise (macros are only allowed in the root dir of a repo, so I'm not sure if that would be an issue)
  • Added new YAML and other file types specific to Unity
  • Set linguist-language to some files that have grammar support (HLSL, JSON, CSS) - linguist reference
  • Set the language for UXML files as xml, which marks it as data and so hides it from language stats, so I also made it linguist-detectable so it shows. My reasoning is that UXML is more HTML than XML if we look at more than just the syntax.
  • Made the "collapse diffs on GitHub" part optional so that users can comment it out to use it
  • There might be more Unity extensions to add. I just created everything under Assets/Create in Unity. There's this link to maybe investigate: Unity docs reference
  • I can also mark some popular paths such as /Assets/Plugins/** or /Assets/TextMesh Pro/** as linguist-vendored if that's fine.

Questions:

  • Why are we defaulting to not using LFS? I'm asking because it seems unintuitive to me that LFS is opt-in instead of default.
  • I didn't recognize the "Spine export file", so I looked it up and it seems to be a 3rd party package, not a global Unity file. Should I remove it?

I tried to make my commits as atomic as possible so we can pick and choose the changes to keep. Let me know if anything needs to change.

@alexkaratarakis
Copy link
Copy Markdown
Member

alexkaratarakis commented Jul 31, 2023

Thanks for the contribution!

Combined some largely reused effects in a macro so it's much more concise (macros are only allowed in the root dir of a repo, so I'm not sure if that would be an issue)

I am not sure how frequent this scenario is. I think it is fine to optimistically accept the macro and hear from users.

Why are we defaulting to not using LFS? I'm asking because it seems unintuitive to me that LFS is opt-in instead of default.

Do you mean setting * to be git lfs, then opting-out for non-binary files? One reason is it wouldn't mix well when composing with other gitattribute templates.

I didn't recognize the "Spine export file", so I looked it up and it seems to be a 3rd party package, not a global Unity file. Should I remove it?

I see it was added in #120 by @lightjiao . While it could be in a third-party-Unity file, I think for just 1 entry it is simpler to leave here.

@alexkaratarakis alexkaratarakis merged commit f8dee49 into gitattributes:master Jul 31, 2023
@FurkanKambay
Copy link
Copy Markdown
Contributor Author

Thanks!

Do you mean setting * to be git lfs, then opting-out for non-binary files? One reason is it wouldn't mix well when composing with other gitattribute templates.

No, we wouldn't touch * or any regular text file, just the ones already marked with binary would be marked lfs instead. I believe most people use it that way already and other templates that I saw around the web also just does that. I already added a comment describing what to do here, but imo it should be default.

@alexkaratarakis
Copy link
Copy Markdown
Member

I see.
I agree that it would be a be reasonable to reverse the comment and logic and mark them lfs by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants