playMaker

Author Topic: EditorStartupPrefs checkout in git  (Read 2085 times)

aberlemont

  • Playmaker Newbie
  • *
  • Posts: 3
EditorStartupPrefs checkout in git
« on: May 05, 2023, 07:19:19 AM »
Hello,

EditorStartupPrefs seems to store some path relative to the user's computer.

I'm currently working on a project with multiple team members.

And everytime we need to discard changes on that file before commiting.

I tried to "ignore" the file but the absence of the file create a tons of error for every person interacting with the git project.

Any best practice I'm missing ?

Thanks for the help !

-Ab

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: EditorStartupPrefs checkout in git
« Reply #1 on: May 05, 2023, 12:03:45 PM »
Hi.
We had the same issue, we solved it by storing it on the same file path on all computers

you should be able to use gitignore but some settings should be pushed/pulled and could give issues if you forget to disable the ignore on it

aberlemont

  • Playmaker Newbie
  • *
  • Posts: 3
Re: EditorStartupPrefs checkout in git
« Reply #2 on: May 08, 2023, 11:19:39 AM »
Thanks for the answer :)

Same path for all : not possible in my context I'm afraid

Not sure I understood what you meant by "soime settings should be pushed/pulled" or "disable the ignore on it" ?

I tried to ignore that file but playmaker REALLY doesn't like it.

I'm guessing from your answer that the way to go would be to have everybody generating that file and then ignoring it.

But it's really not practicle for when new user comes in. There has to be a better way xD.

Why not storing a relative path in that file ? like using Application.dataPath ( https://docs.unity3d.com/ScriptReference/Application-dataPath.html ) instead ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: EditorStartupPrefs checkout in git
« Reply #3 on: May 09, 2023, 07:25:36 AM »
Hi.
Oh I always thought it was a unity thing.
I will contact Alex if this can be changed.

i think it should be possible to do something like :

lastAutoUpdateSignature: 2019.4.40f1__**Assets__0.0.0.0

and replace the ** with the local path in code

aberlemont

  • Playmaker Newbie
  • *
  • Posts: 3
Re: EditorStartupPrefs checkout in git
« Reply #4 on: October 06, 2023, 10:42:47 AM »
Hey djaydino,

I'm not quite sure what you want me to do in your last post ?
local path ? Did you mean relative path ?

to have a proper context here is the path written in the EditorStartupPrefs.asset on my machine :

lastAutoUpdateSignature: 2022.3.8f1__D:/dev/game/Assets__0.0.0.0

but to some other team member it's :

lastAutoUpdateSignature: 2022.3.8f1__F:/work/clients/unity/Assets__0.0.0.0

My intuition would be that this path should be relative to the Assets of the current opened project (instead of relative to the drive) :

lastAutoUpdateSignature: 2022.3.8f1__Assets__0.0.0.0

( I waited a bit for new update before bumping that topic just in case something changed :) )

Thanks for the help :)
« Last Edit: October 09, 2023, 04:08:09 AM by aberlemont »

cheese_block

  • Playmaker Newbie
  • *
  • Posts: 19
Re: EditorStartupPrefs checkout in git
« Reply #5 on: September 19, 2024, 07:34:47 AM »
Hi aberlemont,

Having the same problem - did you ever find a good solution to this?

Thanks

dylanmacdonald

  • Playmaker Newbie
  • *
  • Posts: 1
    • my perfect hotel
Re: EditorStartupPrefs checkout in git
« Reply #6 on: September 20, 2024, 04:05:15 AM »
The EditorStartupPrefs file stores machine-specific paths, causing conflicts in Git. To avoid this, add it to `.gitignore` after an initial commit, or use Git hooks to prevent further tracking. Alternatively, manage machine-specific settings separately to minimize issues across team members.

cheese_block

  • Playmaker Newbie
  • *
  • Posts: 19
Re: EditorStartupPrefs checkout in git
« Reply #7 on: September 20, 2024, 06:26:46 AM »
Thanks

So it's definitely only needed locally? It was just the comment above - "I tried to ignore that file but playmaker REALLY doesn't like it." - that worried me. Didn't want to ignore it if it's going to cause problems.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15552
  • Official Playmaker Support
Re: EditorStartupPrefs checkout in git
« Reply #8 on: September 20, 2024, 07:29:15 AM »
Hi,

 What do you mean it doesn't like it?

Basically, the problem will be if you are sharing for the first time this project, and install it on a new computer, then the project will not be fully defined, I think one could commit it once and then lock it to prevent further commits of them files. then your project stored online will be whole yet not create the typical issues of concurrent commits of conflicting editor files. Each dev has it's own way of working with Unity editor.

Bye,

Jean

cheese_block

  • Playmaker Newbie
  • *
  • Posts: 19
Re: EditorStartupPrefs checkout in git
« Reply #9 on: September 20, 2024, 09:06:34 AM »
Hi Jean,

The comment I mentioned was from a previous poster on this thread - not sure exactly the problems they were having and I haven't tried it yet myself - but your comment makes sense.

So it's important that the update happen if Application.dataPath changes is that correct? The location of the whole project is important in this case? I was just wondering if I could remove Application.dataPath from the project signature or if that will cause problems.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15552
  • Official Playmaker Support
Re: EditorStartupPrefs checkout in git
« Reply #10 on: September 21, 2024, 04:52:46 AM »
Hi,

 no no, the problem needs to be addressed differently.

You can't change, edit or force the application data path, instead you need to work around it and add all the files you don't want to share on your repository in the .gitignore file, so that git simply do not deal with it.

I have a repository with a .gitignore that's specifically for unity projects, and in there you can see that I ignore the editor prefs.

that's all you need to do to solve this problem



warning: you need to have the ignore rules setup prior commiting, else it will be at least forced once on other dev willing to checkout this rep on their computer.

Does that make sense?

Bye,

Jean