build-image icon indicating copy to clipboard operation
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

Open overlordofmu opened this issue 5 years ago • 2 comments

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.

overlordofmu avatar Feb 19 '20 10:02 overlordofmu

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.

ian-woolf avatar May 02 '20 19:05 ian-woolf

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?

paulkre avatar Mar 24 '21 12:03 paulkre