Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unix line breaks with text serialization

Discussion in '2018.1 Beta' started by mikelortega, Jan 31, 2018.

  1. mikelortega

    mikelortega

    Joined:
    Feb 5, 2014
    Posts:
    47
    Hi,

    I serialize Unity files in text mode so I can track them with Git or SVN.
    I've just realized that Unity 2018.1.0b4 saves .prefab .meta .mat files with Unix line breaks (LF) instead of Windows (CR LF), like previous versions of Unity. This creates changes in files that actually do not change. I've tried changing Editor Settings -> Line Endings for New Scripts -> Mode: Windows... but that's only for scripts.

    Is it an intended behavior? Will future versions of Unity save text files with Unix line breaks?

    Thank you.
     
  2. Evaldas_Unity

    Evaldas_Unity

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    83
    Hey mikelo,

    I tried reproing this by creating a project in 2017.3, initializing git, setting all the serialization thingies, and switching to 2018.1.0b4, and git had no changes for me.

    Could you try reproing from scratch (empty project)?

    If you're able, submit that repro project through bug reporter with all the usual how to repro steps and what not and leave the case # here and I will look into it : )
     
    Peter77 and LeonhardP like this.
  3. mikelortega

    mikelortega

    Joined:
    Feb 5, 2014
    Posts:
    47
    Well, I don't consider it to be an error, but I wanted to know if Unix line breaks will be used in all future versions. I've been inspecting projects and it seems the change was made somewhere from Unity 5.6 (Windows line breaks) to 2017.2 (Unix line breaks). Git can handle both perfectly, and you can configure it with AutoCrLf so it doesn't report these changes. I don't know if this can be configured with SVN, I'll check it on Monday.

    Thank you Evaldas.