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

git lfs fsck could not be checked: no such file or directory #5867

Open
RuRo opened this issue Sep 17, 2024 · 1 comment
Open

git lfs fsck could not be checked: no such file or directory #5867

RuRo opened this issue Sep 17, 2024 · 1 comment
Labels
enhancement patches-welcome The core team will accept patches for this feature, but is not planning to implement it themselves.

Comments

@RuRo
Copy link

RuRo commented Sep 17, 2024

Describe the bug

Running git lfs fsck ${ROOT_COMMIT_SHA}..HEAD is quite likely to produce errors like these:

objects: openError: blah.txt (e4...90) could not be checked: no such file or directory
objects: repair: moving corrupt objects to path/to/repo/.git/lfs/bad

I think that the problem is that LFS may not fetch all the objects from the remote, unless you actually check out the commits that refer to that object. Manually running git lfs fetch --all fixes the issue, but it's quite inconvenient (and might fetch more files than required).

IMO, git lfs fsck should try to fetch the missing objects before reporting errors (or maybe even just check their existence on the remote without downloading them, if this is possible). Alternatively, if changing the default behavior of git lfs fsck is problematic for some reason, this could be enabled by adding a --fetch flag.

System environment

NixOS 24.11

git-lfs/3.5.1 (3.5.1; linux amd64; go 1.22.5)
git version 2.45.2
@chrisd8088
Copy link
Member

Hey, thanks for the suggestion! Having a --fetch option seems like a good enhancement to me. I'll mark this issue as such and put it into our backlog, and if anyone has time to contribute a PR with an implementation and some tests, that would certainly be welcome!

@chrisd8088 chrisd8088 added enhancement patches-welcome The core team will accept patches for this feature, but is not planning to implement it themselves. labels Sep 17, 2024
@chrisd8088 chrisd8088 moved this to Optional Enhancements in Backlog Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement patches-welcome The core team will accept patches for this feature, but is not planning to implement it themselves.
Projects
Status: Optional Enhancements
Development

No branches or pull requests

2 participants