build-image
build-image copied to clipboard
Don't set a GIT_LFS_FETCH_INCLUDE and always clone the actual content for all Git LFS tracked files
Currently the build image only clones the actual file contents for Git LFS tracked files for file extensions listed here:
https://github.com/netlify/build-image/blob/xenial/buildbot-git-config#L2
Quoting:
fetchinclude = *.jpg,*.png,*.jpeg,*.svg,*.gif,*.pdf,*.mp4,*.bmp
This behavior can be overridden by setting GIT_LFS_FETCH_INCLUDE
to a more inclusive list in the build environment with that environment variable.
I wonder if we might be better off never filtering and always cloning the any Git LFS files regardless of filetype.
This issue helped my fix my build failures. I had some .JPG files stored in Git LFS in my repo (that's how they come off the camera ¯\_(ツ)_/¯) and my build was failing with the following message:
error Failed to retrieve metadata from image /opt/build/repo/src/img/gallery/P1050936.JPG Input file contains unsupported image format
I had a hunch Git LFS was involved, but didn't know exactly how. When I saw this post I renamed them all to .jpg and it works.
Not necessarily a +1, because I don't know the motivation for this restriction, but I wanted to say thanks.
I agree, while it should definitely still be possible to define a custom selection of LFS files, the default behaviour should be GIT_LFS_FETCH_INCLUDE=*
. This is the way it works for git clone
so why not on Netlify?