You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
smudge filter assumes the "origin" remote exists and has the missing files #2169
defaultRemote is origin, and my repo doesn't have a origin remote
Some possible fixes:
I've noticed the use of git.DefaultRemote() elsewhere. However I'm unfamiliar with the codebase, so I don't know if it's really that simple. It seems to be better than hardcoding origin though, and I may have already patched my system git-lfs to use it.
At the very least, a better error message that catches attempts to use non-existent remotes
AFAIK there's no way to know the remote in a pull like the pre-push hook does. Not that it matters since the smudge filters run on checkout. Maybe git can be extended to allow git-lfs to track what commits come from what remotes, or maybe a simpler shotgun approach where git-lfs queries all the remotes until it has found all files.
As a workaround you can either do GIT_LFS_SKIP_SMUDGE=1 git pull && git lfs pull, rename your remote to origin, or set lfs.url so there's only one git lfs server
Hi @srjek, thanks for opening this issue and spending the time to look into the inner-workings of what's going on here. My inclination is to:
Keep the behavior where the transfer queue is initialized with "", which is the zero-value for type string and the default value if the transfer queue is instantiated outside of its constructor.
Do the same for the *endpointGitFinder type for the same reasons.
Lazily instantiate defaultRemote to be either:
x, where x is the name of a remote in the repository, if there is only one remote
origin, if it exists and there is more than one remote
nil, if there are more than one remotes, and none of them are named origin
I think this is the best that we can do without assuming much beyond a naming convention that origin is the pseudo-default remote. I'm curious of your thoughts on this.
As a workaround you can either do GIT_LFS_SKIP_SMUDGE=1 git pull && git lfs pull, rename your remote to origin, or set lfs.url so there's only one git lfs server
That being said, I think skipping the smudge on git pull and then following that up with a git lfs pull is the least destructive work-around for now.
x, where x is the name of a remote in the repository, if there is only one remote
origin, if it exists and there is more than one remote
nil, if there are more than one remotes, and none of them are named origin
The only issue I have is that as described is it ignores the tracked remote for a branch. If the tracked remote is taken into account, then the method could be the same as calling git.DefaultRemote(), which would make it consistent with other commands like git lfs pull.
If the tracked remote is taken into account, then the method could be the same as calling git.DefaultRemote(),
I don't know if I'd roll this into git.DefaultRemote(), but I agree that we should respect the remote tracking branch (if there is one). I think the priority would be the same as above, preferring the remote tracking branch unless a non-empty remote was given, in which case we should use that.
Turns out that git.DefaultRemote() already grabs the tracked remote for the current ref. However, some of the code still relies on the CurrentRemote string property on config.Configuration. I've combined the two in #2700 to roll out with LFS v2.4.0.
Activity
ttaylorr commentedon Apr 24, 2017
Hi @srjek, thanks for opening this issue and spending the time to look into the inner-workings of what's going on here. My inclination is to:
"", which is the zero-value for typestringand the default value if the transfer queue is instantiated outside of its constructor.*endpointGitFindertype for the same reasons.defaultRemoteto be either:x, wherexis the name of a remote in the repository, if there is only one remoteorigin, if it exists and there is more than one remotenil, if there are more than one remotes, and none of them are namedoriginI think this is the best that we can do without assuming much beyond a naming convention that
originis the pseudo-default remote. I'm curious of your thoughts on this.That being said, I think skipping the smudge on
git pulland then following that up with agit lfs pullis the least destructive work-around for now.srjek commentedon Apr 24, 2017
The only issue I have is that as described is it ignores the tracked remote for a branch. If the tracked remote is taken into account, then the method could be the same as calling
git.DefaultRemote(), which would make it consistent with other commands likegit lfs pull.ttaylorr commentedon Apr 24, 2017
I don't know if I'd roll this into
git.DefaultRemote(), but I agree that we should respect the remote tracking branch (if there is one). I think the priority would be the same as above, preferring the remote tracking branch unless a non-empty remote was given, in which case we should use that.technoweenie commentedon Oct 27, 2017
Turns out that
git.DefaultRemote()already grabs the tracked remote for the current ref. However, some of the code still relies on theCurrentRemotestring property onconfig.Configuration. I've combined the two in #2700 to roll out with LFS v2.4.0.