Git LFS Diff not working

I am trying to set up Git LFS with my project. However, the diff on blueprints doesn’t seem to work as it appears to be trying to diff the pointer files rather than the assets themselves.

The error I receive is:

The file '(...)/temp-62f998667e73c36f69cf2de466f0b29a766fb6c6-BP_ExampleBP.uasset' contains unrecognizable data, check that it is of the expected type

I wasn’t sure, since the plugin is part of Unreal now, if I should be bugging this here or on SRombauts Github repo

Setup for the project:

  1. Create new project in Unreal
  2. Create a project on bitbucket
  3. Create a git repo locally
  4. Enable LFS through the settings
  5. Configure Git LFS on PC according to these instructions
  6. Set the filter to be *.uasset
  7. Create a blueprint and check it in
  8. Verify it has been turned into a pointer by running git show HEAD:name_of_blueprint.uasset this should return something like the example below.
  9. Now make a change to the blueprint, right click>source control>diff and observe the error.

The result from the git show command should resemble something like this:

 version https://git-lfs.github.com/spec/v1
 oid sha256:a7d99214e92792af2638464caa4af2863c2b8beaedf26d97b54e56e4304a7bc0
 size 31503

Hi ,

I think I may have been able to reproduce the issue that you are seeing, but in order to make sure would you be able to provide the error message that you are getting and the steps you are following to trigger it?

I seem to be having the same issue in UE 4.12.5. The error message is:

“Unable to load assets to diff. Content may no longer be supported?”

EDIT: Created an example project on GitHub – I know it targets 4.12 rather than OP’s 4.11. I didn’t have 4.11 around.

Hi zhennTil,

That matches the error that I saw. Were you viewing the commit history of a Blueprint, then right-clicked one of the commits and selected the “Diff against previous commit” option?

Hi , I had the BP editor open and hit File → Diff → Revision …, but I get the same results when following your steps.

You’re right . The git plugin diffs with the pointer file.

Looking at SRombauts’ repo, when diffing with a specific revision it uses git show [rev]:[path] to dump that file to a temporary location, but this dumps the pointer file as you suspected.

Yeah the fix looks straight forward - just pipe the result of git show [rev]:[path] into git lfs smudge into a file. The best bit? Even works if the file is not a pointer file, just returns the original file. Only awkwardness it won’t work if user doesn’t have LFS installed so would need to detect that.

n.b. untested through the plugin, I’ve just been messing around on the command line but can’t see why it wouldn’t work.

Hi everyone,

Thanks for pointing this out to us. I have entered UE-34539 to investigate this further. Since SRombauts still works on this plugin, it may be a good idea to report this on his repo as well.

The bug doesn’t actually mention LFS which is pretty crucial! Thanks for bugging it - I will post a link to a pull request if I fix it.

I had not run any tests using LFS. Did you see a different error message than the one mentioned in the report that I linked?

I don’t understand - it works correctly without LFS? The exact error message I see (with LFS installed & configured with the project) is:

The file '(...)/temp-62f998667e73c36f69cf2de466f0b29a766fb6c6-BP_ExampleBP.uasset' contains unrecognizable data, check that it is of the expected type

So the bug you’ve got was just diff-ing any blueprint?

Hi ,

The bug that I saw was from simply doing a diff on a Blueprint without using LFS, so I wouldn’t say that it works correctly without LFS. Your error message is different from what I saw, so I’ll have to try doing some tests using LFS.

Have you made any progress reproducing my bug with LFS?

Hi ,

I actually got pulled off onto some other tasks for a few days. I am just getting back to my normal tasks, so I’ll be looking at this again in the next day or two.

Have the exactly same issue, can’t diff files which are under Git LFS. Would be nice to got the quick fix proposed by **** at least.

Hi ,

I spent some time working on this today using a project using LFS with the git repo. I ran the same test I used previously with some large files (120-180 MB), and ended up with the same error message that I had received previously. I didn’t get the error that you mentioned seeing.

Would you be able to provide some more information regarding how your repo is set up, what files you are using with LFS, and how you are trying to get the diff?

Haha yes proved to be slightly less quick than I’d hoped - I’m having problems with FInteractiveProcess if you have any ideas: FInteractiveProcess not correctly redirecting STDOUT - Programming & Scripting - Epic Developer Community Forums

  • I have updated the question with details of how I setup my project.

Hi ,

Thank you for the additional repro steps you provided. I believe I am now seeing the same message that you described, but it is coming up in the log as a warning instead of an error, and I am not experiencing a crash in the Editor. The diff window also doesn’t open, but in this case I don’t really expect it to do so. I am checking a few more things and should have another ticket entered for this soon.

Hi ,

Just wanted to provide another update. I checked my previous test case to see what, if anything, was being printed to the log when the error message appeared, and it was printing out the same warning message. I hadn’t checked the log previously because it appeared that the error message was what I was looking for. I updated my previous ticket to include the warning message and included a mention of Git LFS as well.