SRombauts / UEGitPlugin

Unreal Engine 5 Git LFS 2 Source Control Plugin (beta)
http://srombauts.github.io/UEGitPlugin
MIT License
808 stars 165 forks source link

Rebase workflow: conflicts not detected! #37

Open Memnarch opened 7 years ago

Memnarch commented 7 years ago

My Problem: I have Development and Featurebranch(remote and locally) and i am using git-lfs. I made changes to my featurebranch and using normal Rebaseworkflow, i want to rebase it on my local copy of development. However this has the following problems:

1)The UI in editor does not support anything besides pulling/pushing from/to the remote 2)I need to use my GitExtensions to start the rebase, which works but 2a) Lots of "can not unlink old file xy" (since my editor is open) 2b) any conflict which occurs is not detected in the Mergetool(i can't click Prev/Next Conflict) 3)if i keep the editor closed while rebasing and conflicts occur, openng the ditor will not show assets being part of the conflict so opening the Mergetool is not possible(i know, this is not your problem but that's what i struggle with)

Memnarch commented 7 years ago

btw how do i iniate a merge? if i have to iniate a merge from git-commandline or gitextensions, i face the same problems as above: -can not unlink files (while ue4 editor is open)

SRombauts commented 7 years ago

Hi,

First of all, the Source Control in UE4 has been built around Perforce:

  1. with file locking, so no conflict ever. For Subversion they enforced the same Locking mechanism.
  2. without any "feature branches" so no merge nor any rebase

To have a good experience with Git, you should try to use a workflow that avoid relying on branch/merge, and try to avoir conflicts by splitting the workload and using other collaborative tools.

I didn't try merge-conflicts in a while, but you have(had) to close the Editor, use you GUI/CLI git tool, than reopen the Editor to manage conflicted files. Then you can only choose one version or the other to keep , so this it not a real merge at all! Let me know if this is not working as intended.

Cheers!

Memnarch commented 7 years ago

Okay if it is just pick a or b that it is already the same as with git itself -.- If you reopen the editor during conflicts, you can not pick the assets anywhere. Thanks for the answer

SRombauts commented 7 years ago

No, I mean, there IS a "Blueprint Visual Diff merge viewer" (and texte comparisons for other assets like Materials). But the Visual Diff viewer is just a viewer showing what has been change in the Blueprint, help choose the "best" version,

Memnarch commented 7 years ago

I only know of the diff/merge tools visible when a blueprint is open but they always work only for the currently open blueprint. I know of no other option :/

SRombauts commented 7 years ago

When you create two git branches, modify the same blueprint on the two branches, and then merge those two branches together (with UE4 Editor closed) you get a conflict.

  1. "git status" should says that the Content/Xxx/Yyy_BP.uasset file is in conflict.
  2. then, launching the Editor, you should get a "Warning" icon on your Blueprint in the Content Browser
  3. then the context menu should give you an option to "Solve" (or "Merge", I don't recall precisly) the conflict
  4. this should open a window with a 3-way Merge Window (3 views) of your Blueprint, with colors showing the diffferences

Let me know if this is not working for you, and in which version of the Engine.

SRombauts commented 7 years ago

Also, it could be a problem with UE vs Git LFS! I never tried to merge with Git LFS!

Edit: and Git LFS Diff Viewer only works since UE4.16 Preview

Memnarch commented 7 years ago

Nope, Blueprint will not showup in ContentBrowser

Memnarch commented 7 years ago

AH ok, so with upcoming 4.16 it should work? (at least getting the conflicts in editor?)

SRombauts commented 7 years ago

I am not sure if will work since I never tried to merge with Git LFS. The newest version of the plugin fixes the "visual diff" in the History of a Blueprint

Also, you can try to install the plugin from my release page to replace the one shipped with Unreal Engine so that you can already try to see if it works for you.

I will try and will update the plugin if needed!

SRombauts commented 7 years ago

Please, test the 2.0 release of the plugin, installing (clone or unzip) it in your project "Plugins" folder (create this folder if this is your first project plugin)

Then report here if it works any better

Memnarch commented 7 years ago

Mergeconflicts so far don't show up, however i simply readded my changes afterwards(thus overriding those introduces from rebase) and tried to diff/merge against previous commit. Was not able to load the bp for diffing :/

EDIT: tried with v2

SRombauts commented 7 years ago

Could you send me your log please?

SRombauts commented 7 years ago

Git LFS visual diff in history (compare with previous commit) should work under Windows but would require Git 2.10 (README.md could be more precise about that)

Memnarch commented 7 years ago

I use git 2.12.0.windows.1 GitLFS 2.0.2 I'll look into sending logs later. Right now i started duplicating my assets to get the diffs

danielfinke commented 6 years ago

I think that I am having the same problem as @Memnarch. If a blueprint asset is marked as a conflict by Git, it won't be visible in the Content Browser at all. There is no way to get to the BP merge tool. Furthermore, trying to use the tool on any non-conflicted BP gives the error:

Aborted Load of "\<asset path>" because we could not get the requested revision Failed to load asset(s) for merge.

git version 2.14.2.windows.1 git-lfs/2.3.0 (GitHub; windows amd64; go 1.8.3; git 4dd2bf73)

MattSynapse commented 2 years ago

Hey, we are actually experimenting a problem with the rebase conflict process. The merging conflict process is working smoothly, I have both the source and destination blueprint diff in Unreal when I merge from my branch feature to develop. However, when doing a rebase of my feature branch on develop and there is a conflict on a BP, I do not have the feature branch version on Unreal.

I inspected the unreal logs, and find out the same error on git commands :

Warning LogSourceControl fatal: HEAD does not point to a branch

It seems that when the HEAD is detached, the plugin does not handle the diffs correctly. Even more, in a rebase situation, with the plugin source control active before starting Unreal and once the editor started, if I open the source control window, let the settings as they are (Git LFS 2) and click "Accept Settings" I have an error, the same as the one above.

I'll try to inspect the code and fix it because we really need to be able to resolve conflicts on uasset in a rebase process ! But if anyone has already fixed it or know how to do it, please share it :p

Here is a part of the unreal logs :

Log          LogSourceControl     ExecuteSynchronousCommand(UpdateStatus)
Log          LogSourceControl     RunCommand: 'git symbolic-ref --short --quiet HEAD'
Warning      LogSourceControl     RunCommand(symbolic-ref) ReturnCode=1:
Warning      LogSourceControl     
Log          LogSourceControl     RunCommand: 'git log -1 --format="%h"'
Log          LogSourceControl     RunCommand: 'git status --porcelain --ignored "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     ParseStatusResults: 2) General case for one or more files (D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset, ...)
Log          LogSourceControl     Status(D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset) = 'UU Content/Blueprints/BP_PlayerCharacter.uasset' => 8
Log          LogSourceControl     RunCommand: 'git ls-files --unmerged "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-remote origin HEAD detached at 03a47a2 "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git log --pretty= --name-only HEAD..HEAD@{upstream} "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Warning      LogSourceControl     RunCommand(log) ReturnCode=128:
Warning      LogSourceControl     fatal: HEAD does not point to a branch
Warning      LogSourceControl     
Log          LogSourceControl     RunCommand: 'git log --follow --date=raw --name-status --pretty=medium MERGE_HEAD --max-count 1 "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Warning      LogSourceControl     RunCommand(log) ReturnCode=128:
Warning      LogSourceControl     fatal: ambiguous argument 'MERGE_HEAD': unknown revision or path not in the working tree.
Warning      LogSourceControl     Use '--' to separate paths from revisions, like this:
Warning      LogSourceControl     'git <command> [<revision>...] -- [<file>...]'
Warning      LogSourceControl     
Log          LogSourceControl     RunCommand: 'git log --follow --date=raw --name-status --pretty=medium "D:/Unreal/Cassandras-Fate/Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-tree --long 29a5c25f "Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-tree --long 679995f8 "Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-tree --long 3e1c5d96 "Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-tree --long 1198eb53 "Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git ls-tree --long 8f6c710b "Content/Blueprints/BP_PlayerCharacter.uasset"'
Log          LogSourceControl     RunCommand: 'git log -1 --format="%H %s"'
Log          LogSourceControl     RunDumpToFile: 'git -C "D:/Unreal/Cassandras-Fate" cat-file --filters 29a5c25f58a5d487cadf6a32109fdd172e7c6af1:Content/Blueprints/BP_PlayerCharacter.uasset'
Log          LogSourceControl     Writed 'D:/Unreal/Cassandras-Fate/Saved/Diff/temp-29a5c25f58a5d487cadf6a32109fdd172e7c6af1-BP_PlayerCharacter.uasset' (127723o)