Skip to content
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

LFS files are duplicated where COW is not supported #772

Open
olsen232 opened this issue Jan 19, 2023 · 1 comment
Open

LFS files are duplicated where COW is not supported #772

olsen232 opened this issue Jan 19, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@olsen232
Copy link
Collaborator

olsen232 commented Jan 19, 2023

On Windows - and potentially other platforms, depending on the filesystem - copy-on-write is not supported.
Currently, Kart simply does a regular copy, which means all LFS files that are checked out in the working copy are also present
in the LFS cache, which is inefficient use of disk space.

There is more than one possible fix:

One is to lock the files: make the files readonly, require the user to notify Kart before editing making any edits to them, and at the time that the user asks to edit a file, Kart will make a copy of that file (ie, change the file from being a symlink to the original, to a copy of the original).

Another is to let the user edit the files, but try to detect which ones the user has edited - using hashes and timestamps, much like our/Git's current change detection logic. If we detect file is edited, it should be evicted from the LFS cache before we use it for anything which we need the original file for. The actual original can be re-downloaded from the remote. However, note that this only works if there is a remote - if the files were committed locally and haven't been pushed, the LFS cache is the only place they have been stored, so in this case we would need to use one of the other behaviours (multiple copies of the same file, or locked files to prevent edits before we are ready).

@rcoup
Copy link
Member

rcoup commented Jan 25, 2023

One is to lock the files

This is how git annex works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants