-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the issue
I have a use case where I would like some way to get the temporary download URLs for files stored in LFS.
In our project, we use git LFS for some artifacts and bazel for building. As not all LFS files are required on all platforms and for all builds, I wanted bazel to drive downloading LFS files by need, with normal git LFS checkout disabled via .lfsconfig files and lfs.fetchinclude/lfs.fetchexclude.
As bazel has its own way of managing downloads (avoiding too many downloads at the same time and caching them), I needed a way to provide it download URLs for LFS files. By reading up on the LFS protocol I came up with this script which works pretty well in the general case. However, it turned out to be pretty fragile on the authentication side (there are so many ways git and git lfs can authenticate!).
Would it be possible to have a plumbing command exposed that would provide those URLs directly out of git lfs, so that I would not have to go through the headache of reimplementing the whole authentication routine?
What I'm thinking is something like
git lfs batch-request path/to/file path/to/another/file
that would return the response to a batch request for the files listed as inputs. Even better if a --skip-local or similar flag would make this skip files that are already smudged on disk, and only process LFS pointers (but I could also do that kind of filtering on my side).
cc @criemen