-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Using git lfs pull --include ...
in a Shallow clones and sparse checkout causes git to download all blobs one by one.
#5689
Comments
Hey, I don't think we can do that. We need the size of the blob to determine whether it can be a pointer file or not, since large blobs can't be pointers, and it's not efficient to scan very large blobs if we don't need to. If we didn't have the size, we'd still have to download every blob, which would perform even worse on partial clone and just awfully in general on large working trees without partial clone, since we'd be processing many more files than we needed to. I agree this performs terribly in this case. I also tried with Since you have a good reproduction case, it would be good to use |
I agree that the files are not fetched as a batch is a core git issue. The issue gets far worse as the repo scales. Currently; GIT-LFS requires that the blobs are populated, even for files that it does not track given the way it calls If I've read the code correctly (not a GO programmer) the size field could be used slightly later in the call stack. Side note |
Okay, I have #5699, which should apply that suggestion, but doesn't yet wire up the sparse functionality. I think that can come in a future revision with the rest of the sparse checkout functionality. |
The PR looks great 👍. Glad the filters were helpful; they were new to me. Good catch on making the formatting the same. |
It will be released in v3.6, since it's a new feature, but we don't have concrete plans to do that at the moment. It will likely be a couple months. |
Describe the bug
LFS's use of the
git ls-tree
with-l
when using the--include
option in a filtered clone causes git to fetch the missing blobs one by one.Omitting the
-l
, does not happen.To Reproduce
Observations:
The
ls-tree
run with-l
, is far slower.The
git lfs pull
callsls-tree
with-l
.Expected behavior
Allow
git ls-tree
to make a first pass without the-l
option when it is only used to filter path names.System environment
Mac OS
Output of
git lfs env
git lfs env
git-lfs/3.4.1 (GitHub; darwin arm64; go 1.21.5)
git version 2.44.0
Endpoint=https://github.com/git-lfs/git-lfs.git/info/lfs (auth=none)
SSH=git@github.com:git-lfs/git-lfs.git
LocalWorkingDir=/Users/mrosenquist/git-lfs
LocalGitDir=/Users/mrosenquist/git-lfs/.git
LocalGitStorageDir=/Users/mrosenquist/git-lfs/.git
LocalMediaDir=/Users/mrosenquist/git-lfs/.git/lfs/objects
LocalReferenceDirs=
TempDir=/Users/mrosenquist/git-lfs/.git/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/Users/mrosenquist/git-lfs/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=/opt/homebrew/opt/git/libexec/git-core
GIT_TRACE2_PARENT_NAME=run_dashed
GIT_TRACE2_PARENT_SID=20240327T232438.979651Z-Hbf43c273-P00017815
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
Additional context
The use of
-l
onls-tree
prevents the manual filtering to match sparse-checkout rules whilegit-lfs
does not directly support sparse checkouts.Related issue
The text was updated successfully, but these errors were encountered: