Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: show image previews for images tracked by lfs #2981

Open
zvinless opened this issue Oct 7, 2017 · 4 comments · May be fixed by #17686
Open

Feature request: show image previews for images tracked by lfs #2981

zvinless opened this issue Oct 7, 2017 · 4 comments · May be fixed by #17686

Comments

@zvinless
Copy link

zvinless commented Oct 7, 2017

I suspect this has already been suggested/closed/written down somewhere, but I didn't find anything after a cursory search, so:

Basically, bring the GitHub site and original GitHub Desktop functionality to the cool new GitHub Desktop

  • Show image previews of lfs-tracked images as if they were plain image files
    • Show image preview when file is selected in Changes list or commit list
    • Show two images when displaying a diff with the four image diff modes
  • Indicate that the file is tracked in LFS with a badge, or maybe just by showing the LFS pointer file contents
  • Show a "Pull LFS File" button if the file does not exist locally (never downloaded, pruned, etc)

Mockup for if you have the image locally:
haslocalcontent

If the file does not exist locally:
nolocalcontent

In a diff:
nolocaldiff
(Not sure about the 4 image diff options when both files aren't present; I just grayed them out but there's probably a better solution)

This would make using GitHub Desktop much more intuitive for artists or anyone dealing with images.

@shiftkey
Copy link
Member

@technoweenie I got curious about this one and went looking at the Git LFS docs - is there a recommended way to be able to read the contents of an asset using git-lfs to stdout? The best example I can think of from Git is git show [sha]:[path] and I couldn't find an equivalent for LFS.

@technoweenie
Copy link

technoweenie commented Oct 27, 2017

The easiest way right now is to invoke the smudge filter manually:

$ git show [sha]:[path] | git lfs smudge

As a bonus, this will download the file locally to .git/lfs/objects, if necessary.

It will work with regular blobs, but LFS will complain about it.

# filename arg after 'git lfs smudge' is optional
# it provides a filename hint to lfs warning at the bottom
$ git show master:.gitattributes | git lfs smudge .gitattributes
*.gif filter=lfs diff=lfs merge=lfs -crlf
*.png filter=lfs diff=lfs merge=lfs -crlf
*.jpg filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
Pointer file error: Unable to parse pointer at: ".gitattributes"

You can tell it to shut up:

$ git show master:.gitattributes | git lfs smudge 2>/dev/null
*.gif filter=lfs diff=lfs merge=lfs -crlf
*.png filter=lfs diff=lfs merge=lfs -crlf
*.jpg filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text

sh0c pushed a commit to sh0c/desktop that referenced this issue Nov 6, 2023
@sh0c
Copy link

sh0c commented Nov 6, 2023

Hello, I made some changes in code that made possible to show diff between images in fork of the repository using git lfs smudge.
Here is link - https://github.com/sh0c/desktop/tree/lfs-image-diff

sh0c pushed a commit to sh0c/desktop that referenced this issue Jan 20, 2024
sh0c pushed a commit to sh0c/desktop that referenced this issue Feb 26, 2024
sh0c pushed a commit to sh0c/desktop that referenced this issue Mar 2, 2024
sh0c pushed a commit to sh0c/desktop that referenced this issue Apr 8, 2024
sh0c pushed a commit to sh0c/desktop that referenced this issue Apr 19, 2024
sh0c pushed a commit to sh0c/desktop that referenced this issue May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants