Skip to content
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

Prevent VCS thrashing - Use platform-independent paths in OpenVRSettings #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dessix
Copy link

@Dessix Dessix commented Jan 15, 2022

OpenVRSettings rewrites the Assets/XR/Settings/Open VR Settings.asset on project startup; it continues where the original fix to #11 left off.

This change avoids inconsistent serialization across platforms, preventing VCS conflicts between team-members across Linux / Windows / Mac editor targets.

As the Unity built-in VCS integration does not understand the concept of path equivalence, this avoids conflicts in naive "sync" workflows and unnecessary differences in working trees.

Serialized formats for cross-platform files should not use System.IO.Path.DirectorySeparatorChar unless they replace it during encoding and substitute the consistent variant during decoding. As all target platforms for the editor support forward-slash paths, a constant avoids the whole issue.

Additionally, this PR:

  • Eliminates an unnecessary side-effect-free computation of a new path when not in the editor
  • Corrects inconsistent usage of indentation (Awake was indented with tabs while the rest was spaces)

`OpenVRSettings` rewrites the `Assets/XR/Settings/Open VR Settings.asset` on project startup; it continues where the original fix to ValveSoftware#11 left off.

This change avoids inconsistent serialization across platforms, preventing VCS conflicts between team-members across Linux / Windows / Mac editor targets.

As the Unity built-in VCS integration does not understand the concept of path equivalence, this avoids conflicts in naive "sync" workflows and unnecessary differences in working trees.

Serialized formats for cross-platform files should not use `System.IO.Path.DirectorySeparatorChar` unless they replace it during encoding and substitute the consistent variant during decoding. As all target platforms for the editor support forward-slash paths, a constant avoids the whole issue.


Additionally, this PR:
- Eliminates an unnecessary side-effect-free computation of a new path when not in the editor
- Corrects inconsistent usage of indentation (`Awake` was indented with tabs while the rest was spaces)
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.

1 participant