Search Unity

Smart Merge not working

Discussion in 'Formats & External Tools' started by cyrusthegreater, Apr 2, 2015.

  1. SidarVasco

    SidarVasco

    Joined:
    Feb 9, 2015
    Posts:
    163
    I noticed that different tools handle the commandline tools differently.

    When using Tortoise Git there is info being displayed. When using Sourcetree everything is handled in the background silently. So if Im uncertain I use tortoise git to merge my scenes to check if it goes ok.
     
  2. AmbOcclusion

    AmbOcclusion

    Joined:
    Sep 17, 2012
    Posts:
    33
    I'm on OSX and I actually have an issue where using Smart Merge completely clears a file's contents when I use it. I use Sourcetree on git version 2.7.4 using the Smart Merge included with Unity 5.3.4f1. When I use it either through SourceTree or the Terminal, it boots me to FileDiff, and the Terminal outputs what seems like it finding diffs but then that boots me to FileDiff too.

    The result when it's done is always a completely empty file, unreadable by Unity.
     
    Last edited: Apr 12, 2016
  3. jetpackpony

    jetpackpony

    Joined:
    Feb 25, 2016
    Posts:
    2
    UnityYAMLMerge doesn't work for me on Ubuntu 15.10.
    Here is the output I get:
    $ git mergetool --tool=unityyamlmerge
    Merging:
    myGame/Assets/Game.cs
    myGame/Assets/myGame.unity

    Normal merge conflict for 'myGame/Assets/Game.cs':
    {local}: modified file
    {remote}: modified file
    Couldn't locate dir of factory merge spec file

    Couldn't locate dir of factory merge spec file
    Couldn't load spec file 'mergespecfile.txt'

    myGame/Assets/Game.cs seems unchanged.
    Was the merge successful? [y/n] n
    merge of myGame/Assets/Game.cs failed
    Continue merging other unresolved paths (y/n) ? y

    Normal merge conflict for 'myGame/Assets/myGame.unity':
    {local}: modified file
    {remote}: modified file
    My path is invalid

    Cannot open rules file for reading:mergerules.txt

    myGame/Assets/myGame.unity seems unchanged.
    Was the merge successful? [y/n] n​

    After this both files are with conflicts stay unchanged.
    I've added the tool's location into path. Both files 'mergespecfile.txt' and 'mergerules.txt' exist and have 777 permissions.
    The Unity version:
    Version 5.3.2f1 (112c408b1c75) Personal
    Mon, 08 Feb 2016 15:20:19 GMT
    Branch: 5.3/linux/editor​
    My Ubuntu is 15.10.
    Please help!
     
  4. ELineCEng

    ELineCEng

    Joined:
    Sep 13, 2014
    Posts:
    8
    Thanks for responding! I am a novice regarding Windows batch scripting but am slowly learning the ropes.

    I managed to detect UnityYAMLMerge setting errorlevel 1 when the tool encounters a conflict but lacks a fallback program (not errorlevel 2 like I expected, but as long as the errorlevel is non-zero then its all the same to me). I did this by purposely disabling the P4Merge entry from the list of default merge programs given in mergespecfile.txt.

    My latest problem is that, when UnityYAMLMerge does fall back to P4Merge, P4Merge does not appear to update the errorlevel no matter the outcome of merging. Does anyone know how to detect when p4merge.exe saves the merged file?

    Thanks,
    Chris
     
    Last edited: Apr 13, 2016
  5. nindim

    nindim

    Joined:
    Jan 22, 2013
    Posts:
    130
    @jdrewsen I have just submitted a bug report with some scenes attached that cause UnityYAMLMerge to crash. I'm in the middle of a big branch catch up and have two scenes that crash the merger... Any chance you could take a look ASAP? Thanks!
     
  6. leighgraner

    leighgraner

    Joined:
    Aug 9, 2012
    Posts:
    4
    Hi @jdrewsen, I am attempting to use UnityYAMLMerge with SVN on a Mac. I've edited the ~/.subversion/config file to include merge-tool-cmd = /Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge as instructed, but scene merges still all result in conflicts, just as before. I've ensured that our scene files are in YAML format, and that the mime-type property for the scene file is set to text/plain. What else can I do to try to get it to work, or to determine whether svn is attempting to run UnityYAMLMerge?
     
  7. Aeradon

    Aeradon

    Joined:
    Dec 3, 2013
    Posts:
    1
    Hi @jdrewsen and everyone,

    Today I tried really hard (for something like 4 hours) try to make UnityYAMLMerge work with tortoiseGit.
    Get the setup working was actually pretty easy, but then the problems started.

    First thing I noticed was that it took like 40 seconds to parse my scene (its a 55k line file, 2.3MB, so it looked ok).

    After that, UnityYAMLMerge reported (correctly) 1 conflict in an integer attribute, and tried to open the three way diff in my fallback merge tool (and that took another 40 seconds to happen). But, for my surprise, my merge tool (I tried with tortoiseGitMerge and Per4Merge) reported that there were no differences whatsoever between any of the files (base, mine or theirs).

    After trying to reconfigure everything and restarting my computer (who knows) I tried again with the exact same scene merge and, for my surprise, UnityYAMLMerge crashed. 100% reproduceable, I tried 3+ times and it crashed on all of them. =/

    After that I tried once again, reconfigured everything, reverted my merge and did it again. This last time it took more than 5 minutes to do the merge, reported (correctly) 1 conflict in an integer attribute, and after another 2 minutes waiting it opened the fallback merge tool. Another surprise, all three files were empty. On this last attempt, I also noticed that right before opening the merge tool, it was using 500MB of memory, and during the 7 minutes it was working it used 15 to 20% of my processor.

    Some information about my setup/machine:
    Unity 5.3.4f1 x64, Processor i7 3630QM, Windows 10

    I have no idea where to even start reporting this, IF one or any of these are a bug.

    Maybe I can send you my conflicted scene so you can check it out?

    PS.: This is my first post here at Unity forums =P
     
  8. jonathan.spane

    jonathan.spane

    Joined:
    May 20, 2016
    Posts:
    1
    I have a similar crash as other users have gotten. The crash is the generic the program has stopped working on Windows. I am using Unity 5.1.1f. I followed the manual to link Perforce to .unity and .prefab files as described here: http://docs.unity3d.com/Manual/SmartMerge.html and updated the mergespecfile.txt to use p4merge as the fallback. Despite these steps I am still getting a hard crash when trying to run the merge tool when resolving in Perforce. Any ideas? Thanks.
     
  9. p4dragon

    p4dragon

    Joined:
    Jan 5, 2015
    Posts:
    4
    I've run into a problem using UnityYAMLMerge on OSX. It never seems to call the fallback merge tool.

    I've tried configuring the mergespecfile.txt in multiple ways for both Perforce and Araxis, and the fallback tool never gets launched.

    When configured as an external merge tool in P4V, It fails silently when doing a resolve,

    When I run it from the command line I do get the merged output file, but it seems the fallback tool never gets launched.

    OSX version 10.8.5 Oh - By the way, it seems to work fine in Windows...

    Here's the command line script I'm testing with:

    /Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge merge -p NetworkScoreBarUI.prefab NetworkScoreBarUI.prefab NetworkScoreBarUI1.prefab wow1

    As I said, the file "wow1" gets created.

    Please let me know if I can help hunt this down.
     
  10. David_Playcorp

    David_Playcorp

    Joined:
    Mar 4, 2014
    Posts:
    3
    For people using SourceTree I wrote a custom action that works along with the git setup on https://docs.unity3d.com/Manual/SmartMerge.html

    So if add the:
    [mergetool "unityyamlmerge"]
    trustExitCode = false
    cmd = '<path to UnityYAMLMerge>' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
    segment to your .gitconfig (which on windows 10 is under Users\[USERNAME]\.gitconfig)

    Then you make the custom command as follows: (You might need to change the path to the git.exe depending on where it is installed on your system). You can untick the check boxes if you want - that's up to you.
    CustomAction.PNG

    Then you just select the file you want to resolve click Actions > Custom Actions > UnityYAMLMerge

    I've only tried it one file at a time so if multiple files fail then you'll need to figure out what's going wrong there.
    Hope it helps someone
     

    Attached Files:

    Hello-There-Dev likes this.
  11. AddHomonym

    AddHomonym

    Joined:
    Jan 14, 2014
    Posts:
    1
    Thank you David; that is useful information. I'd just like to add that I had to include the following setting in my .gitconfig

    [mergetool]
    prompt = false

    Otherwise, git prompts the user to press return to start the merge using the tool, and this prompt is not displayed in the SourceTree window, and there is no way to respond to it. From the user's perspective the window will just sit there forever trying to do the merge but not getting anywhere. That setting fixed the issue for me.


    Edit:
    In case @jdrewsen sees this, is it possible to add ".controller" as one of the extensions UnityYAMLMerge will handle without the --force flag? Using a Custom Action is my workaround to that problem, since I don't want to --force it to merge all files in general. Thanks!
     
  12. fdgfdgffdgdfg

    fdgfdgffdgdfg

    Joined:
    Jul 8, 2014
    Posts:
    7

    Hey,

    I have a similar issue on Debian 8. I found a workaround for the:
    Cannot open rules file for reading:mergerules.txt
    I just copied the mergerules.txt and mergesolving.txt in the git folder where I run "git mergetool". It is not ideal but at least the two files are found. I don't know in which environment variable I need to specify the location path of the tool.

    Now unityYAMLmerge starts the merge but I didn't succeed to configure the fallback tool to continue the merge. I would like to use meld so I configured mergesolving.txt like that:
    unity use /usr/bin/meld %b %l %r -o %d
    prefab use /usr/bin/meld %b %l %r -o %d
    * use /usr/bin/meld %b %l %r -o %d

    But it is not working: Couldn't locate merge tool to handle extension in mergespecfile.txt
    It is the same with kdiff3. Any idea? Thanks a lot!
     
  13. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    Hey all. For some unknown reason I haven't received notifications from this thread and therefore did not see your messages before now. There is now a new maintainer for the tool who I will point to this thread asap.

    The best way to help us debug any issues/crashes you identify is to send us the base,left and right yaml files you are trying to merge. Also add a note about the version of Unity you are using. If you cannot attach it to the forum message then just make a bug and post the bug ID here.

    Thanks
     
  14. fdgfdgffdgdfg

    fdgfdgffdgdfg

    Joined:
    Jul 8, 2014
    Posts:
    7
    Thanks for the feedback. Before sending any file, I guess my first question is: does unityyamlmerge work with Linux? I am using the 5.4.1 build from here http://forum.unity3d.com/threads/unity-on-linux-release-notes-and-known-issues.350256/
    But it seems that unityyamlmerge is not able to find the location of the install path (where mergerules.txt and mergesolving.txt are), and cannot launch a fallback merge tool (see my previous post).
    Besides the documentation https://docs.unity3d.com/Manual/SmartMerge.html only mentions Windows and OSX. So can we use the smartmerge under Linux?
     
  15. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    Are you configuring smart merge in your .gitconfig? You should be able to specify paths to mergerules.txt, mergeresolving.txt, mergespecfile.txt etc via command line params.

    I haven't done this in Linux but it should be similar to what I have below in OS X.

    [mergetool "smartmerge"]
    cmd=/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge merge -p -i /Applications/Unity/Unity.app/Contents/Tools/mergeresolving.txt --rules /Applications/Unity/Unity.app/Contents/Tools/mergerules.txt --fallback /Applications/Unity/Unity.app/Contents/Tools/mergespecfile.txt $BASE $REMOTE $LOCAL $MERGED
    trustExitCode = true

    Does this work for you?
     
  16. fdgfdgffdgdfg

    fdgfdgffdgdfg

    Joined:
    Jul 8, 2014
    Posts:
    7
    Yes, thank you. I didn't know about the arguments -i, --rules and --fallback. Now the config files are found.
    I have also configured mergespecfile.txt to use kdiff3 as a fallback (see enclosed). It seems to work pretty well.

    Thanks again!
     

    Attached Files:

  17. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    Awesome! Good to hear it worked out for you.
     
  18. Tim-Page

    Tim-Page

    Joined:
    Nov 23, 2015
    Posts:
    3
    I wasn't able to get unityyamlmerge working until 5.5, but the version with the beta is working for almost all of my scene and prefab files. This is very exciting, since scene merges have been a real problem for us. Thanks for the wonderful tool!

    However, out of several dozen files, it fails on three. I'm figuring they're triggering edge case bugs with the tool. I was hoping you could look into them for us. Any advice would be gratefully received. If we can change the files to workaround the crash, that would be great.

    To confirm, this is using the tool from Unity 5.5.0b4, although the project the files are in is Unity 5.3.4p2. Most files merge fine, these are rare exceptions. And this is on OSX 10.11.6.

    I've attached the files in question.



    Two fail with a useful error message:


    Output result: 78
    Clone base roots: 0
    Merging premerge: 9
    libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Cannot find transform parent for fileID
    /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-mergetool--lib: line 133: 96899 Abort trap: 6 /Applications/Unity_5.5.0b4/Unity.app/Contents/Tools/UnityYAMLMerge merge -p --describe --timing $BASE $REMOTE $LOCAL $MERGED
    Eclair/Assets/Dynamic/Core/Prefabs/TopPanelCanvas.prefab seems unchanged.
    Was the merge successful? [y/n]



    The remaining one fails with the slightly less useful:


    tims-mbp:Eclair tim$ git mergetool Eclair/Assets/Dynamic/Scenes/GachaScene.unity

    Merging:

    Eclair/Assets/Dynamic/Scenes/GachaScene.unity


    Normal merge conflict for 'Eclair/Assets/Dynamic/Scenes/GachaScene.unity':

    {local}: modified file

    {remote}: modified file

    Reading unique keys: 0

    Read base, left and right: 1315

    Read files: 1315

    Creating mappings: 0

    Preprocess mappings: 10

    Waiting for left diff: 16

    Creating diffs: 16

    Merging: 0

    Cloning base roots: 8

    /Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/git-mergetool--lib: line 133: 97036 Segmentation fault: 11 /Applications/Unity_5.5.0b4/Unity.app/Contents/Tools/UnityYAMLMerge merge -p --describe --timing $BASE $REMOTE $LOCAL $MERGED

    Eclair/Assets/Dynamic/Scenes/GachaScene.unity seems unchanged.

    Was the merge successful? [y/n]



    Thanks!
    Tim
     

    Attached Files:

  19. Redphoenix666

    Redphoenix666

    Joined:
    Jul 12, 2016
    Posts:
    8
    As this is probably the most appropriate place to ask, next to reddit maybe (where I have posted the same issue in hope to get some intel):


    I am working with a small team in a student project. We are using TortoiseSVN (GUI) together with Unity, but what troubles us the most are unmergeable scenes. That's when I discovered SmartMerge with this thread:

    https://www.reddit.com/r/Unity3D/comments/39bdq5/how_to_solve_scene_conflicts_with_unitys_smart/

    So I set up my and my mates TortoiseSVN clients with the merge-tool-cmd in %appdata%\subversion\config as described here: https://docs.unity3d.com/Manual/SmartMerge.html

    When I am now working in a scene doing things, and a mate commits his changes to the very same scene, I still get conflicts after shooting an Update.

    So, is anyone here having some sort of advice or even a solution for this problem? Not beeing able to merge scenes is one of the biggest drawbacks right now.

    Cheers, and thanks
     
  20. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    Hi Redphoenix666 - most un-conflicting changes to scenes should merge fine. Although there are definitely cases where the merge can fail. If you have any specific examples of files that did not merge correctly I can take a look. What we need to debug is the original file before you made changes (i.e. the base), the file with your changes and the file that the other user made.
     
  21. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    Hey Tim - sorry for the delay in response. I checked out the files you posted earlier and do see something going on in those. The merge does get very complex if you have a ton of changes so more chances of hitting edge cases. While merge does help in lot of cases it is definitely advisable to keep syncing your changes so it does not get too messy at the end. I went ahead and filed bugs for your examples. Thanks for reporting!
     
  22. Redphoenix666

    Redphoenix666

    Joined:
    Jul 12, 2016
    Posts:
    8
    It's the scene itself (as wel las .prefabs) that arent merging at all.
    Thats the reason why I want SmartMerge in the first place: We are a small team who work in the same scene all the time. Not beeing able to Merge it is just a pita.

    I cannot hand you any files since I would have to send you the whole project. For me, it looks like TortoiseSVN isnt firing YAMLMerge when theres a conflict, but I added the merge-tool to the subversion config.
     
  23. ELineCEng

    ELineCEng

    Joined:
    Sep 13, 2014
    Posts:
    8
    @Redphoenix666

    I am also trying to integrate SmartMerge into my studio's existing Windows + TortoiseSVN workflow. Here is what I have found:

    1. Despite what https://docs.unity3d.com/Manual/SmartMerge.html suggests, setting

    [helpers]
    merge-tool-cmd = <path to UnityYAMLMerge>

    in the Subversion config is not honored by TortoiseSVN. Instead, I must instruct TortoiseSVN to use SmartMerge for .unity and .prefab extensions by following the instructions given for TortoiseGit. (Right-click any empty area in Windows Explorer, select TortoiseSVN, select Settings, select Merge Tool, select Advanced, and add new entries for .unity and .prefab.) Here is the exact string I use:

    "C:/Program Files/Unity/Unity542f2/Editor/Data/Tools/UnityYAMLMerge.exe" %base %mine %theirs %merged foo

    Be sure to change the path to wherever your SmartMerge is located. Also note that if SmartMerge is launched without the first argument being merge, then SmartMerge assumes an SVN client is launching it and thus expects exactly five arguments, where the first four are the files needed for merging and the last is the "wcfile", which doesn't seem to matter so I just pass in "foo".

    2. Even after setting TortoiseSVN to use SmartMerge for .unity and .prefab files, TortoiseSVN will not automatically launch SmartMerge upon encountering a versioning conflict for those files (i.e. after an update). Instead, TortoiseSVN automatically attempts a typical text-merge (i.e. a non-interactive merge), and only then reports the files as conflicted should that fail. For non-trivial .unity and .prefab files, this fails nearly every time.

    3. So what did setting SmartMerge as the .unity and .prefab conflict solver actually do? It declared to TortoiseSVN that SmartMerge is the interactive merge tool for those files, i.e. the tool launched when we right-click a conflicted file in Windows Explorer, select TortoiseSVN, then select Edit Conflicts. SmartMerge finally begins its work.

    4. If SmartMerge cannot merge the conflicting files by itself, then it will fall back to one of the merging tools defined in mergespecfile.txt. If you have installed P4Merge in the default location, then SmartMerge should find and launch P4Merge without issue. I have also successfully directed SmartMerge to find and launch TortoiseMerge just for fun. Regardless of the merge tool, the conflicts must be manually edited and saved by you.

    5. Despite my efforts, I have not been able to get TortoiseSVN to notice that I have saved & closed the merge tool, thus automatically marking the conflict as resolved and deleting the .mine, .rOldRev, and .rNewRev files. Instead, I must inform TortoiseSVN manually by right-clicking the now-merged file, the selecting TortoiseSVN, then selecting Mark Resolved. This is a departure from typical interactive merges, which is annoying.

    If anyone sees any mistakes or misunderstandings above, please let me know!

    I hope that helps!
    -Chris



    BONUS: I have attached the SVN config, mergespecfile.txt, and mergerules.txt files to this post. Getting SmartMerge integrated into TortoiseSVN does not require any modifications to these files, but there are some useful options available.

    In the SVN config file, you may notice that I have added the following unnecessary but convenient options:

    [miscellany]
    preserved-conflict-file-exts = doc ppt xls od? unity prefab
    enable-auto-props = yes

    [auto-props]
    *.unity = svn:mime-type=text/yaml
    *.prefab = svn:mime-type=text/yaml

    The preserved-conflict-file-exts will cause the .mine, .rOldRev, and .rNewRev filenames to always end in .unity (or .prefab) so that SmartMerge will not be fooled into thinking these are unknown file types. (Otherwise, you will need to use the --force parameter to force SmartMerge to attempt merging the files.) The auto-props will allow TortoiseSVN to understand that .unity and .prefab files are YAML text files, not binary files, and are thus eligible for non-interactive merges.

    In the mergespecfile.txt, I added a TortoiseMerge entry like so:

    # Tortoise Merge
    * use "%programs%\TortoiseSVN\bin\TortoiseMerge.exe" -base:"%b" -theirs:"%r" -mine:"%l" -merged:"%d"

    And in the mergerules.txt, I added the following exclusions for Transforms:

    exclude *.Transform.m_LocalPosition
    exclude *.Transform.m_LocalRotation
    exclude *.Transform.m_LocalScale
     

    Attached Files:

    nixalott and Drum_stick like this.
  24. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @ELineCEng Thanks for jumping in. Yes those params are required by the merge tool.

    Btw I'm curious why you exclude the Transform properties. Are you running into a problem with those?
     
  25. ELineCEng

    ELineCEng

    Joined:
    Sep 13, 2014
    Posts:
    8
  26. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @ELineCEng Yes that is correct. I'm looking at SmartMerge now.

    Also yes the issue you mentioned regarding some of the structures like Vector3f, ColorRGBAf, Quaternionf etc was fixed in 5.4
     
  27. chefgamett

    chefgamett

    Joined:
    Aug 20, 2016
    Posts:
    4
    can i use this tool to find diffs between workspace version of an asset file and the version that exists on P4? e.g ProjectSettings.asset - what would be the P4V settings for that?
     
  28. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
  29. chefgamett

    chefgamett

    Joined:
    Aug 20, 2016
    Posts:
    4
    I read that page - it's talking about setting up a 3-way merge on P4. I'm asking about setting it up to do diffs (e.g. if I've made a local change, and I press Ctrl-D, I want to see what changed)
     
  30. Danilodum14

    Danilodum14

    Joined:
    Jul 16, 2015
    Posts:
    1
    Hi, I'm getting the error 'Unmapped key when trying to reorder mapping keys', I've attached the scenes (base remote local) that cause the error. Any thoughts? I'm on linux.
     

    Attached Files:

  31. PJBowron

    PJBowron

    Joined:
    Dec 13, 2016
    Posts:
    8
    I wonder if anyone could elaborate on the purpose of the "unity use ..." and "prefab use ..." lines within mergespecfile.txt when using git for source control?

    When resolving a conflict, git creates temporary files, passing base, local and remote files as random.tmp; therefore the 'unity' and 'prefab' patterns are never matched.

    It seems that, if trying to only use unityYamlMerge for .unity and .prefab conflicts when using git, it would be better to set up entries in .gitattributes to associate yamlMerge with these two file types?
     
    Ziflin likes this.
  32. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @Danilodum14 It merges fine for me (i.e. returning the conflicting changes). Which version of Unity are you on?
     
  33. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @PJBowron If I understand correctly, setting up .unity and .prefab in gitattributes/gitconfig only tells git when to launch UnityYamlMerge. If you want fallback (for when UnityYamlMerge fails to merge) ... you will also want to have the mergespecfile. Hope that makes sense.
     
  34. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @chefgamett Unfortunately UnityYamlMerge can only do merges ... no diff UI at the moment. Sorry for the delay in response.
     
  35. PJBowron

    PJBowron

    Joined:
    Dec 13, 2016
    Posts:
    8
    @khris1rino Many thanks for the reply. I think, in a roundabout way, I just wanted to highlight and enquire about the limitation that the 'pretty' filenames passed to UnityYamlMerge from Git (which retain .unity/.prefab extensions) get lost when UnityYamlMerge generates temporaries for handoff to the fallback tool. As well as making it harder to understand what you're merging, this prevents the "unity use..." and "prefab use..." definitions in the mergespecfile ever being used. The best you can have is a match against .tmp or the catch-all "*"

    It looks like this was on the original developer's radar a while back:
    https://forum.unity3d.com/threads/unityyamlmerge-a-few-annoying-thing.368512/

    It'd be great if this could get resolved!
     
  36. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @PJBowron I see your point now. Will add that to the todo list. Thanks!
     
  37. svendkiloo

    svendkiloo

    Joined:
    Dec 2, 2014
    Posts:
    11
    I'm getting the error "Couldn't locate merge tool to handle extension tmp in..." as well, when trying to use the merge tool (from SourceTree) on a .prefab file.

    EDIT: If I add a fallback for "tmp" extension (in my case I added TortoiseMerge), it opens that tool with an empty merge...
     
    Last edited: Feb 22, 2017
  38. sergeyzr

    sergeyzr

    Joined:
    Jan 30, 2017
    Posts:
    1
    There seems to be a problem with paths with spaces in them, when I ran "git mergetool" Smart Merge outputted a path that had spaces in it (and it was incomplete) and said "<partial filename> does not exist".
     
    Last edited: Mar 9, 2017
  39. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    @sergeyzr Would be great if you can log a bug (Help->Report a Bug in the menu). That way we can see more information on your setup to debug.
     
  40. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    I'm using UnityYAMLMerge.exe with Git and SourceTree, and it seems working fine with simple test projects so far, but I'm not sure if I'm doing right.
    I read the unity manual and couldn't find anything about '.gitattributes' but when googled about Smart Merge,
    some said we need to put the below lines in .gitattributes.

    *.unity binary
    *.prefab binary
    *.asset binary

    Is this really necessary?
    If so, could you explain why?
     
    Last edited: Mar 16, 2017
  41. khris1rino

    khris1rino

    Unity Technologies

    Joined:
    Mar 23, 2016
    Posts:
    20
    Sounds like a trick to prevent Git from trying to use its own merge tool. Might work if you run into some scenario where Git merges incorrectly and you only want to use UnityYAMLMerge. Not necessary otherwise.
     
  42. UnityIsTheBest

    UnityIsTheBest

    Joined:
    Jul 18, 2015
    Posts:
    11
    Finally clear answer from Unity!!
    Thank you so much, now I know what to do :)
     
  43. bbvrdev

    bbvrdev

    Joined:
    Aug 11, 2009
    Posts:
    221
    Hey Unity devs, when I type "git mergetool", I consistently get the following:

    Normal merge conflict for 'Assets/Scenes/BlackBox.unity':
    {local}: modified file
    {remote}: modified file
    Assets/Scenes/BlackBox.unity seems unchanged.
    Was the merge successful [y/n]? n


    We are creating a test case where both myself and another dev have committed changes, but the merge tool doesn't seem to find them. Any workaround for this? Scene merging is a nightmare for us..
     
  44. janimator

    janimator

    Joined:
    Apr 5, 2013
    Posts:
    52
    I've been trying to get SmartMerge to work for a while now with no success using Windows 7. I keep getting the UnityYAMLMerge Error "Cannot find transform parent for fileID".

    I opened up a project that I'm working on, changed the serialization to force text, set up UnityYAMLMerge as git's merge tool, created a very simple merge conflict on the main scene between two branches and attempted to merge them via "git mergetool" command. In the shell it reads
    before displaying the mentioned error.

    Would love to start using the mergetool so any assistance would be great!
     
  45. bbvrdev

    bbvrdev

    Joined:
    Aug 11, 2009
    Posts:
    221
    Is this thread dead? My last question was in mid-May and I've never heard anything... I'll be sad if UnityYAMLMerge turns out to be abandonware, conceptually it has great promise.
     
  46. mfontoura

    mfontoura

    Joined:
    Oct 12, 2015
    Posts:
    7
    Hope not, this needs to be part of the dev pipeline.
     
  47. njg

    njg

    Joined:
    Feb 6, 2015
    Posts:
    5
    Does UnityYAMLMerge work with 4.x projects/files?
     
  48. AndyMartin458

    AndyMartin458

    Joined:
    Jul 15, 2012
    Posts:
    59
    I'm having a similar issue.
     
  49. AndyMartin458

    AndyMartin458

    Joined:
    Jul 15, 2012
    Posts:
    59
    On windows it just says the .unity file seems unchanged. On Mac however I see this output.

    UnityYAMLMerge(66362,0x700006801000) malloc: *** mach_vm_map(size=2305843009213693952) failed (error code=3)
    *** error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    UnityYAMLMerge(66362,0x70000677e000) malloc: *** mach_vm_map(size=2305843009213693952) failed (error code=3)
    *** error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
    libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
    /usr/local/Cellar/git/2.13.0/libexec/git-core/git-mergetool--lib: line 128: 66362 Abort trap: 6 '/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge' merge -p $BASE $REMOTE $LOCAL $MERGED
    <redacted my scene file name>.unity seems unchanged.

    I'm using Unity 2017.4.0f1
     
  50. jyfc

    jyfc

    Joined:
    Feb 19, 2016
    Posts:
    9
    Any chance of getting meld merge on the fallback defaults list?