-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the bug
git lfs checkout opens an ssh connection (in my case) to the remote origin server to run git-lfs-transfer. This is not expected because the git itself does not communicate with remote servers during git checkout operations. Even the manual page for git lfs checkout says: "Try to ensure that the working copy contains file content for Git LFS objects for the current ref, if the object data is available. Does not download any content; see git-lfs-fetch(1) for that".
This issue is particularly problematic during use of a slow and expensive Internet connection.
Expected behavior
git lfs checkout should have complained about non-local files, but should not have tried to communicate with the remote origin.
Please, correct me if this behavior is an intended one.
System environment
Linux amd64, git runs natively (no containers, etc). The origin remote uses SSH: "url = ssh://...".
Environment contains GIT_LFS_SKIP_SMUDGE variable which is set to 1.
Output of git lfs env
git-lfs/3.2.0 (GitHub; linux amd64; go 1.18.3)
git version 2.38.1
LocalWorkingDir=
LocalGitDir=
LocalGitStorageDir=
LocalMediaDir=lfs/objects
LocalReferenceDirs=
TempDir=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=lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=/usr/libexec/git-core
GIT_LFS_SKIP_SMUDGE=1
GIT_PAGER=vim -
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
In my case some files are not present locally:
# git lfs checkout
Skipped checkout for [...], content not local. Use fetch to download.
[...]
With GIT_CURL_VERBOSE=1 ssh interactions can be seen:
# env GIT_CURL_VERBOSE=1 git lfs checkout
trace git-lfs: exec: git 'version'
trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel'
trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
trace git-lfs: exec: git 'config' '--includes' '--local' 'lfs.repositoryformatversion'
trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
trace git-lfs: exec: git 'config' '--includes' '-l'
trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' ':.lfsconfig'
trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' 'HEAD:.lfsconfig'
trace git-lfs: attempting pure SSH protocol connection
trace git-lfs: run_command: ssh [...] git-lfs-transfer [...] download
[...]