SRombauts / UEGitPlugin

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

LFS Diff Support #32

Closed thk123 closed 7 years ago

thk123 commented 7 years ago

This extends the RunDumpToFile to handle LFS pointer files. It first checks if LFS is installed and the file is a pointer file. If it is, then it pipes the output from git show in to git lfs smude which is the command to retrieve the actual file contents. This is then saved to the same temp file that was previously being used.

If either the file isn't a pointer file or LFS isn't installed then it just outputs the file to the temp file as it did before.

To get this working - I needed to use FInteractiveProcess to both send data in and read data out of git lfs smudge. However, this didn't allow the setting of a Working Directory (which seemed to be equired for the LFS command to work). So I duplicated this class and added support for this. Ideally this change would be merged back into UE4.

SRombauts commented 7 years ago

Thank you for sibmitting this!

Are you by any chance using UE4 under OSX ? Because I was able to work with lfs under Windows without all this : lfs under Windows does not use symlinks but actual copy of files, or at least that was what I understood at that time...

thk123 commented 7 years ago

No I am on Windows (10) using git through Git Extensions (i.e. cygwin).

When I run git show HEAD:Path/to/file.uasset in a command line I see the pointer file rather than the file itself - which explained why the diff wasn't working. The actual retrieving, pushing & opening of LFS files etc was working fine if that's what you meant by able to use under Windows?

SRombauts commented 7 years ago

Okay, so Cygwin is the "culprit"... I'll have to check all this by myself then.

I am not sure on the implication of the 'working directory" stuff...

Le lun. 19 sept. 2016 18:39, thk123 notifications@github.com a écrit :

No I am on Windows (10) using git through Git Extensions (i.e. cygwin).

When I run git show HEAD:Path/to/file.uasset in a command line I see the pointer file rather than the file itself - which explained why the diff wasn't working. The actual retrieving, pushing & opening of LFS files etc was working fine if that's what you meant by able to use under Windows?

— You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub https://github.com/SRombauts/UE4GitPlugin/pull/32#issuecomment-248047039, or mute the thread https://github.com/notifications/unsubscribe-auth/AA1AinoIRk4H8Yj1iAXgvwPI5Tki8Gemks5qrrrdgaJpZM4KAWi3 .

thk123 commented 7 years ago

Ah OK - how do you use Git, I thought Cygwin was the "standard" way?

The working directory stuff really just wants to be a pull request on Unreal - I just don't have the source code checked out at the moment. What's the process you've been using for getting changes to this plugin incorporated into the Unreal builds?

On Mon, Sep 19, 2016 at 5:43 PM Sébastien Rombauts notifications@github.com wrote:

Okay, so Cygwin is the "culprit"... I'll have to check all this by myself then.

I am not sure on the implication of the 'working directory" stuff...

Le lun. 19 sept. 2016 18:39, thk123 notifications@github.com a écrit :

No I am on Windows (10) using git through Git Extensions (i.e. cygwin).

When I run git show HEAD:Path/to/file.uasset in a command line I see the pointer file rather than the file itself - which explained why the diff wasn't working. The actual retrieving, pushing & opening of LFS files etc was working fine if that's what you meant by able to use under Windows?

— You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub < https://github.com/SRombauts/UE4GitPlugin/pull/32#issuecomment-248047039>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AA1AinoIRk4H8Yj1iAXgvwPI5Tki8Gemks5qrrrdgaJpZM4KAWi3

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SRombauts/UE4GitPlugin/pull/32#issuecomment-248047982, or mute the thread https://github.com/notifications/unsubscribe-auth/AAm-kK9LQEd_OwcQQ4eA7kHjZFFjH7BCks5qrruXgaJpZM4KAWi3 .

SRombauts commented 7 years ago

I am using Git for Windows https://git-scm.com/download/win (or https://git-for-windows.github.io/) In my experience, it's faster than through Cygwin.

To get things integrated into Unreal Engine, I have to make Pull Requests to Epic Games like anyone else.

Cheers!

SRombauts commented 7 years ago

Hi @thk123, I am sorry I was not aware of the Git LFS diff issue you reported on AnswerHub. I was so sure that this had been working for me that I didn't take it with enough care :(

The fix you provided was also complex/scary and I was very busy with other stuffs. But now someone reported the issue to me #35, and someone else have provided a very simple and elegant fix EpicGames/UnrealEngine#3057 (not using git show + smudge but a simple git checkout).

Once again, I am deeply sorry for my bad behavior on your Pull Request!

SRombauts