FredrikNoren / ungit

The easiest way to use git. On any platform. Anywhere.
MIT License
10.44k stars 637 forks source link

Image diffs not working on Git LFS #915

Open FredrikNoren opened 7 years ago

FredrikNoren commented 7 years ago

When I change an image, it's no longer shown as a diff in the UI. Only the new version of the image is show.

@codingtwinky any ideas?

jung-kim commented 7 years ago

Ah... Can you clarify what situation? My tests on bot diff on staging and git commit bubble was successful.

screen shot 2017-05-07 at 21 16 19
FredrikNoren commented 7 years ago

Hm odd, neither of those work for me:

In this case it's a changed image (should be two images here with an arrow): screen shot 2017-05-08 at 12 51 50 pm

And here too, but here even the changed image doesn't show: screen shot 2017-05-08 at 12 51 16 pm

Maybe there's some issue with getting the image from git (which would explain why it doesn't work in the second image). I'm on git 2.11.0 (Apple Git-81) and I think you're on windows right?

jung-kim commented 7 years ago

Nope, on mac as well. Maybe one of unmerged changes inadvertently fixed it? I will try out the master branch later but I'm flying out yet again so it maybe late

jung-kim commented 7 years ago

@FredrikNoren Does this problem still exists?

FredrikNoren commented 7 years ago

@codingtwinky oh I think I get what's going on here. The repo is using git large file storage, so when ungit runs git show HEAD:thefile.png, the output is just:

version https://git-lfs.github.com/spec/v1
oid sha256:bfbb3d533ddd53a3b0713079ed87e1efaed80f3066c6fe072b6557890d0022cc
size 64397

instead of the actual image.

ajostergaard commented 6 years ago

Hi guys - I guess this means ungit doesn't support LFS? If not, any plans to support it?

jung-kim commented 6 years ago

@ajostergaard At worst case of scenario, this seemingly means LFS tracked images are not properly displayed in Ungit UI.

@FredrikNoren I've just tested LFS tracked images with ungit and it seems to be functional. Is this still a problem?

freedomfamilygames commented 3 years ago

@jung-kim I just tested it, and it seems to still be a problem, though it's not universal; files committed before git lfs was added display without any issues, even when you alter them again later. However, all images added after git lfs was installed and added to the project show as broken images. A silent error is thrown when attempting to examine them, shown below:

stderr: (node:13964) UnhandledPromiseRejectionWarning: #<Object> (node:13964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)

Tried restarting the process, refreshing the page, and making an edit to a file that wasn't displaying properly to see if it was an issue just with initialized but unmodified files. All cases failed. The only passing cases are when a file is added before git lfs is applied to it.