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

staging changes breaks git lfs #586

Closed
bugzpodder opened this issue Feb 28, 2019 · 12 comments · Fixed by #724
Closed

staging changes breaks git lfs #586

bugzpodder opened this issue Feb 28, 2019 · 12 comments · Fixed by #724

Comments

@bugzpodder
Copy link

I am using git lfs and the feature that automatically stash things is definitely broken with my setup (converting file pointers to files in lfs):

$ lint-staged
  ✔ Stashing changes...
  ❯ Running linters...
    ❯ Running tasks for src/**/*.{js,jsx}
      ✔ prettier --write
      ✖ eslint --fix
        git add
    Updating stash...
    Restoring local changes...

Immediately after I am getting Encountered 1 file(s) that should have been pointers, but weren't: errors. I have to blow away my entire folder everytime this happens. Can we have an option to disable this new feature, otherwise I have to downgrade to v7 or look for an alternative..

@okonet
Copy link
Collaborator

okonet commented Mar 1, 2019

Ideally we’d have a fix for this case. Do you know why it’s happening and how to fix it? PRs are open. If you don’t want to do it, go ahead and downgrade.

@bugzpodder
Copy link
Author

bugzpodder commented Mar 1, 2019

It broke serveral dev's workflow and I had to downgrade. I couldn't even fix it manually and had to rm -rf everything, so I definitely don't know why it broke or how to fix it (nor does anyone else I've talked to).

I know you put a lot of work in this feature (i read your blogpost), but to be honest I have no idea why it is useful (ie my workflow was totally fine before this) or why I need it (seem like an optional feature rather than a must-have critical one). I know it's must be useful to someone or otherwise you would not have worked on this problem for years, I am just pointing out that I don't know how it is useful for my workflow. Maybe you could put up a few lines in README to explain in what situations would it be helpful?

@okonet
Copy link
Collaborator

okonet commented Mar 1, 2019

Then you should just use v7 if you don’t need this. That said I still would love to see a fix for the lfs.

@bugzpodder bugzpodder changed the title Turn off partially staged feature staging changes breaks git lfs Mar 1, 2019
@bugzpodder
Copy link
Author

A small update to this in case someone knows their git. My git commit got stuck for 20 minutes, I interrupted it and this was the output:

yarn run v1.13.0
$ lint-staged
⠴ Stashing changes...
✖ Stashing changes...
→ Exiting because of "interrupt" signal.
Running linters...
Error: Command failed: git checkout-index -af

@okonet okonet reopened this Mar 2, 2019
@okonet
Copy link
Collaborator

okonet commented Mar 2, 2019

Can you at least post debug logs? Please see the readme.md if you’re not sure how to run in debug mode.

@bugzpodder
Copy link
Author

Sorry, couldn't repo just now, will check again next time and report back if I get something.

@bugzpodder
Copy link
Author

bugzpodder commented Mar 7, 2019

Stuck again (checking out lfs things), had to Ctrl + C.

yarn run v1.13.0
$ lint-staged --debug
  lint-staged:bin Running `lint-staged@8.1.5` +0ms
  lint-staged:find-bin Loaded package.json using `process.cwd()` +0ms
  lint-staged Loading config using `cosmiconfig` +0ms
  lint-staged Successfully loaded config from `/Users/bugzpodder/app/package.json`:
  lint-staged { concurrent: false,
  lint-staged   linters:
  lint-staged    { 'src/**/*.{js,jsx}':
  lint-staged       [ 'prettier --write',
  lint-staged         'eslint --rule flowtype/require-valid-file-annotation:2 --fix',
  lint-staged         'git add' ],
  lint-staged      'config-overrides.js': [ 'prettier --write', 'eslint --fix', 'git add' ],
  lint-staged      'cypress/**/*.js': [ 'prettier --write', 'eslint --fix', 'git add' ],
  lint-staged      '*.{scss,json,md}': [ 'prettier --write', 'git add' ],
  lint-staged      '*.config.js': [ 'prettier --write', 'eslint --fix', 'git add' ] } } +3ms
  lint-staged:cfg Normalizing config +0ms
  lint-staged:cfg Validating config +2ms
Running lint-staged with the following config:
{
  concurrent: false,
  linters: {
    'src/**/*.{js,jsx}': [
      'prettier --write',
      'eslint --rule flowtype/require-valid-file-annotation:2 --fix',
      'git add'
    ],
    'config-overrides.js': [
      'prettier --write',
      'eslint --fix',
      'git add'
    ],
    'cypress/**/*.js': [
      'prettier --write',
      'eslint --fix',
      'git add'
    ],
    '*.{scss,json,md}': [
      'prettier --write',
      'git add'
    ],
    '*.config.js': [
      'prettier --write',
      'eslint --fix',
      'git add'
    ]
  },
  chunkSize: ……,
  globOptions: {
    matchBase: true,
    dot: true
  },
  ignore: [],
  subTaskConcurrency: 1,
  renderer: 'verbose',
  relative: false
}
  lint-staged:run Running all linter scripts +0ms
  lint-staged:run Resolved git directory to be `/Users/bugzpodder/app/` +0ms
  lint-staged:run Loaded list of staged files in git:
  lint-staged:run [ 'app/src/components/items.jsx',
  lint-staged:run   'app/src/components/item.jsx',
  lint-staged:run   'app/src/common/components/labels/label.jsx' ] +100ms
  lint-staged:gen-tasks Generating linter tasks +0ms
  lint-staged:cfg Normalizing config +106ms
  lint-staged:gen-tasks Generated task: 
  lint-staged:gen-tasks { pattern: 'src/**/*.{js,jsx}',
  lint-staged:gen-tasks   commands:
  lint-staged:gen-tasks    [ 'prettier --write',
  lint-staged:gen-tasks      'eslint --rule flowtype/require-valid-file-annotation:2 --fix',
  lint-staged:gen-tasks      'git add' ],
  lint-staged:gen-tasks   fileList:
  lint-staged:gen-tasks    [ '/Users/bugzpodder/app/src/components/items.jsx',
  lint-staged:gen-tasks      '/Users/bugzpodder/app/src/components/item’,
  lint-staged:gen-tasks      '/Users/bugzpodder/app/src/common/components/labels/label.jsx' ] } +14ms
  lint-staged:gen-tasks Generated task: 
  lint-staged:gen-tasks { pattern: 'config-overrides.js',
  lint-staged:gen-tasks   commands: [ 'prettier --write', 'eslint --fix', 'git add' ],
  lint-staged:gen-tasks   fileList: [] } +1ms
  lint-staged:gen-tasks Generated task: 
  lint-staged:gen-tasks { pattern: 'cypress/**/*.js',
  lint-staged:gen-tasks   commands: [ 'prettier --write', 'eslint --fix', 'git add' ],
  lint-staged:gen-tasks   fileList: [] } +1ms
  lint-staged:gen-tasks Generated task: 
  lint-staged:gen-tasks { pattern: '*.{scss,json,md}',
  lint-staged:gen-tasks   commands: [ 'prettier --write', 'git add' ],
  lint-staged:gen-tasks   fileList: [] } +1ms
  lint-staged:gen-tasks Generated task: 
  lint-staged:gen-tasks { pattern: '*.config.js',
  lint-staged:gen-tasks   commands: [ 'prettier --write', 'eslint --fix', 'git add' ],
  lint-staged:gen-tasks   fileList: [] } +1ms
Stashing changes... [started]
  lint-staged:git Stashing files... +0ms
  lint-staged:git Running git command [ 'write-tree' ] +1ms
  lint-staged:git Running git command [ 'add', '.' ] +74ms
  lint-staged:git Running git command [ 'write-tree' ] +711ms
  lint-staged:git Running git command [ 'read-tree', ‘……………………….…’ ] +57ms
  lint-staged:git Running git command [ 'checkout-index', '-af' ] +285ms
GB-C02X65BYJHD3:client bugzpodder$ Stashing changes... [failed]
→ Error: Command failed: git checkout-index -af
...
Downloading foo/bar.csv (4 MB)
...
Exiting because of "interrupt" signal.

@okonet
Copy link
Collaborator

okonet commented Mar 7, 2019

There is something in how git checkout-index works with lfs. I have never used lfs before so I can not tell. Could you help investigate this?

@bugzpodder
Copy link
Author

Sorry, I avoid dealing with git lfs whenever possible so I probably can't offer anything more of value here.

@bugzpodder
Copy link
Author

fixes by #663

@okonet
Copy link
Collaborator

okonet commented Oct 31, 2019

🎉 This issue has been resolved in version 9.5.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@okonet
Copy link
Collaborator

okonet commented Jan 19, 2020

🎉 This issue has been resolved in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants