-
Notifications
You must be signed in to change notification settings - Fork 20
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
"git-fat filter-smudge" should support pulling missing fat files. #56
Comments
This one I'm unsure about. I'll leave this open for discussion, but I think I'd prefer it not be the case that it lazy loads the files during a smudge. I know that's what git-lfs does, but I believe that it leads to very messy edge case handling. For example, if a filter fails and returns non-zero than I believe the checkout is aborted. Otherwise, if some files successfully download and some do not, then what do you do? You've got some which have been replaced and some which haven't. Sure you can print an error, but you can't return an error without creating a (nearly) unrecoverable mess. Basically, I'd prefer if it were all or nothing and putting that behavior in filters prevents that behavior. (It should be noted that the current implementation is not transactional but does not prevent it from being so in a hook). |
I think git-fat already has to deal with some fat files being available and some missing. For example, if I have a directory full of fat files, and I "git checkout" a commit that adds a new such file, but I haven't run "git fat pull" yet, I'll wind up in that inconsistent state. Just off the top of my head, would it be practical to do something like:
I notice there's a |
This is the case yes. When doing a clone for the first time we don't have any fat files on the local filesystem yet so we write out the placeholders. Placeholders in the working copy without a corresponding file in the fat store are what "Orphans" are.
This is exactly correct. We handled this by having a post-checkout hook call git-fat pull (this is the same case as cloning as it turns out).
I didn't know about this. It seems like it could be useful, but I'm not totally sure. To give a bit of context for why the current behavior is the way it is: We wanted to be able to selectively pull files in the repository without pulling all the large files for a particular commit. This was very important for various reasons I won't get into at the moment, but is what leads to the duality of having orphan placeholders and real files in the working tree. While moving push and pull to filters might be a good feature to have added, I don't think it should be the default for git-fat. In any case it's going to be challenging technically. However, I wouldn't outright reject it if it came along. Edit: sorry I didn't get into all this in the first response, but your suggestions exercised my memory for the reasons why it is the way it is. :-) |
Aha, I checked |
|
What the post checkout hook did was run a If the hook failed it wouldn't normally affect the result of the checkout, but since we called |
I've been investigating git large-file storage solutions, and while git-fat is more generally useful, GitHub's git-lfs is a bit nicer to use. One reason is that you don't have to manually "git lfs pull" when you "git pull" or "git checkout", because git-lfs' smudge filter will automatically try to download files it doesn't have cached locally.
I'm not sure whether this is something that git-fat should do by default; on the one hand, there's no guarantees that the user will have the required network connectivity when "git checkout" runs; on the other hand, maybe trying and failing and printing an error message would be better than git-fat's current behaviour (silently checking out un-smudged stubs).
I would like to have one of the following behaviours:
--auto-fetch
. "git-fat init" should also have an extra command-line option that installs the smudge filter with the--auto-fetch
option.The text was updated successfully, but these errors were encountered: