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
git clone --filter=tree:0 --depth=1 --no-checkout --no-tags [email protected]:git-lfs/git-lfs.git
cd git-lfs
git sparse-checkout set commands --cone
git checkout main
# Git ls-tree without -l
time git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'ls-tree' '-r' '-z' '--full-tree' HEAD
# Git ls-tree with -l
time git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'ls-tree' '-l' '-r' '-z' '--full-tree' HEAD
GIT_TRACE git lfs pull -I command 2>&1 | grep ls-tree
Observations:
The ls-tree run with -l, is far slower.
The git lfs pull calls ls-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=[email protected]: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 on ls-tree prevents the manual filtering to match sparse-checkout rules while git-lfs does not directly support sparse checkouts.
Related issue
Describe the bug
LFS's use of the
git ls-treewith-lwhen using the--includeoption 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-treerun with-l, is far slower.The
git lfs pullcallsls-treewith-l.Expected behavior
Allow
git ls-treeto make a first pass without the-loption when it is only used to filter path names.System environment
Mac OS
Output of
git lfs envgit 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=[email protected]: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
-lonls-treeprevents the manual filtering to match sparse-checkout rules whilegit-lfsdoes not directly support sparse checkouts.Related issue