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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lefthook causes git lfs can't store. #611

Open
Demi871023 opened this issue Jan 16, 2024 · 0 comments
Open

Lefthook causes git lfs can't store. #611

Demi871023 opened this issue Jan 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Demi871023
Copy link

馃敡 Summary

Lefthook is causing Git LFS failures. Upon pushing a commit that includes LFS files such as jpg, my local repository exhibits no issues. However, when a colleague attempts to pull the same commit, Git LFS fails to locate the associated LFS files, resulting in an error.

Lefthook version

1.5.5

Steps to reproduce

  1. Add jpg files to the project.
  2. Confirm that the file names are included in the Git LFS tracking by executing the command git lfs ls-files.
  3. Utilize lefthook for pushing the code.
  4. Encounter a file not found error when others attempt to pull the code.

Expected results

Neither push code nor pull code will cause errors.

Actual results

Below is the error message we encountered.

git --no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree checkout -b ycv_1.38_effect_filter --track origin/ycv_1.38_effect_filter 
Downloading assets/effect_preload/effects/mellow_fade/Mellow_Fade_02.jpg (25 KB)
Error downloading object: assets/effect_preload/effects/mellow_fade/Mellow_Fade_02.jpg (5863113): Smudge error: error opening media file: open /Users/xxxx/projectname/.git/lfs/objects/58/63/5863113071a3f649ce8c6774c68bdc556e4e84b2db19c770bcd06730ca588231: no such file or directory

Errors logged to '/Users/xxxx/projectname/.git/lfs/logs/20240115T104854.37545.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: assets/effect_preload/effects/mellow_fade/Mellow_Fade_02.jpg: smudge filter lfs failed

Possible Solution

We think it may have nothing to do with the file name, because changing the name of Mellow_Fade_02 still cannot result the problem.
At present, we are not sure how to improve the problem when using lefthook, so we can temporarily remove lefthook and then push and pull can be done smoothly without encountering lfs problems.

Logs / Screenshots

assert_lefthook_installed: true
pre-push:
  piped: true
  commands:
    linter:
      run: flutter analyze
#    tests:
#      run: flutter test

pre-commit:
  piped: true
  commands:
    format_code:
      glob: '*.dart'
      run: dart format {staged_files} && git add {staged_files}

post-merge:
  commands:
    get_packages:
      tags: pubget
      run: flutter pub get
@Demi871023 Demi871023 added the bug Something isn't working label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant