Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

UnityYAMLMerge: a few annoying thing

Discussion in 'Formats & External Tools' started by exawon, Nov 18, 2015.

  1. exawon

    exawon

    Joined:
    Dec 9, 2013
    Posts:
    12
    Hi,

    I'm using p4merge as a merge tool.
    And I found the arguments are ordered wrong in mergespecfile according https://www.perforce.com/perforce/r12.1/manuals/cmdref/env.P4MERGE.html.
    I correct '%l %r' to '%r %l' whenever mergespecfile is overwritten by Unity Update.

    And one more thing.
    UnityYAMLMerge generates unrecognizable file names for the fallback.

    merge02.png

    Even though the pretty file names are passed as the arguments from SourceTree.

    merge01.png
     
    Last edited: Nov 18, 2015
  2. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    Thanks for the feedback. Will fix the mergespecfile issue and also see what to do about the pretty name issue.
     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I actually tried to use UnityYAMLMerge in the past, but i was never able to tell whether it was working or not...

    I used to select "Resolve conflicts using external merge tool", but it didn't seem to do anything - no window or anything opened and i had no idea whether it actually did something or not...
     
  4. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    "Resolve conflicts using external merge tool" is not unityyamlmerge but is whatever merge tool you have configured in your preferences. If that tool can do a clean merge itself without the need for manual fixups you will not see the external merge tool but just get the resulting merge right away.
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    So by this you mean that UnityYAMLMerge will run automatically when merges are being performed (e.g: after doing a git pull) ?
     
  6. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    Ah.. I though you were using the integrated perforce ui in Unity. I guess you are using git and have enabled UnityYAMLMerge as mergetool on sourcetree or tortoiseGIt? In that case UnityYAMLMerge will do a merge and never show a GUI if it can do it without conflicts. In case of conflicts it will fallback to a 3rd party merge tool for the remaining conflicts. The fallbacks are specified in the mergespecfile.txt which is right next to the tool executable itself.
     
  7. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Thanks for clarifying. Is that process (e.g: mergespecfile.txt) documented anywhere?
    I've tried using UnityYamlMerge a few times but it didn't appear to have done anything so i assumed it simply didn't work... now i know that it must've probably merged the scenes/prefabs by itself.
     
  8. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    Run UnityYAMLMerge.exe and it will show usage including the --fallback option for using a custom mergespecfile.txt. Also have a look at this page explaining about the mergespecfile.txt http://docs.unity3d.com/Manual/SmartMerge.html
     
  9. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I am on OSX, trying to setup UnityYAMLMerge now. The docs seem to be a bit confusing:

    upload_2016-2-17_11-19-58.png

    This is what i have configured:

    upload_2016-2-17_11-26-49.png

    Does this look OK? should i leave out the "diff" command empty ? (i think it should be better stressed out in the docs).

    After merging 2 branches, i still get conflicts in sourcetree, but the tool i have set up in the mergespecs file is not launched immediately:

    upload_2016-2-17_11-27-42.png

    Does this look like a proper configuration? what am i doing wrong ?
     
  10. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    Sourcetree will not automatically popup the mergetool unfortunately. After you get a conflict you need to right click the file that have conflicts and select "Resolve conflicts -> Launch External Merge Tool".
     
  11. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I have nothing configured in the merge tool (see the image above). I left it empty (per the documentation).

    Selecting "Resolve using an external merge tool" does nothing in that case...
     
    Last edited: Feb 17, 2016
  12. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    I see... afaik it was a UI bug in sourcetree where the label was "diff command". It seems that have fixed it to "merge command" now. So just put it in the "merge command" field instead and you should be fine.
     
    liortal likes this.
  13. spider853

    spider853

    Joined:
    Feb 16, 2018
    Posts:
    42
    Can we please have at least a MessageBox that the merge was completed succesiful? If I understand correctly you didn'ty add this to not disrupt the automerge behaviour, but when doing resolve manually, it's hard to tell if everything worked as should and you need to accept the merge whatever that was.
    A messagebox or a log somewhere will be nice.

    *Using TortoiseGit + YAMLMerge