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

v10.0.0-1 stuck #723

Closed
bugzpodder opened this issue Nov 2, 2019 · 6 comments
Closed

v10.0.0-1 stuck #723

bugzpodder opened this issue Nov 2, 2019 · 6 comments

Comments

@bugzpodder
Copy link

bugzpodder commented Nov 2, 2019

v10.0.0-0 didn't have to wait that long

Backing up original state... +0ms
  lint-staged:file Trying to access `/Users/bugzpodder/project/.git/MERGE_HEAD` +0ms
  lint-staged:file Unable to access file `/Users/bugzpodder/project/.git/MERGE_HEAD` with error: +3ms
  lint-staged:file Error: ENOENT: no such file or directory, access '/Users/bugzpodder/project/.git/MERGE_HEAD' +0ms
  lint-staged:git Running git command [ 'ls-files', '--others', '--exclude-standard' ] +31ms
  lint-staged:git Running git command [
  'stash',
  'save',
  '--quiet',
  '--include-untracked',
  'lint-staged automatic backup'
] +445ms
  lint-staged:git Running git command [ 'stash', 'list' ] +2s
  lint-staged:git Running git command [ 'stash', 'apply', '--index', 'stash@{0}' ] +95ms
  lint-staged:git Running git command [ 'clean', '-df' ] +1m
  lint-staged:git Running git command [ 'checkout', '.' ] +397ms
  lint-staged:git Running git command [ 'stash', 'list' ] +441ms
  lint-staged:git Running git command [
  'diff',
  '--unified=0',
  '--no-color',
  '--no-ext-diff',
  '--patch',
  'stash@{0}',
  '-R'
] +100ms
  lint-staged:git Done backing up original state! +1m
Preparing... [completed]
Running tasks... [started]
Running tasks for *.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx) [started]
  lint-staged:make-cmd-tasks Creating listr tasks for commands 'yarn lint:staged' +0ms
  lint-staged:task cmd: yarn lint:staged +0ms
  lint-staged:task execaOptions: { preferLocal: true, reject: false, shell: false } +0ms
yarn lint:staged [started]
yarn lint:staged [completed]
Running tasks for *.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx) [completed]
Running tasks... [completed]
Applying modifications... [started]
  lint-staged:git Running git command [ 'ls-files', '--modified' ] +40s
Applying modifications... [completed]
Cleaning up... [started]
  lint-staged:git Dropping backup stash... +40s
  lint-staged:git Running git command [ 'stash', 'list' ] +195ms
  lint-staged:git Running git command [ 'stash', 'drop', '--quiet', 'stash@{0}' ] +94ms
  lint-staged:git Done dropping backup stash! +258ms
Cleaning up... [completed]
  lint-staged tasks were executed successfully! +2m
✨  Done in 110.68s.
@bugzpodder bugzpodder changed the title v10.0.0-1 cannot find MERGE_HEAD v10.0.0-1 stuck Nov 2, 2019
@bugzpodder
Copy link
Author

Second run:

  lint-staged:git Running git command [ 'stash', 'list' ] +2s
  lint-staged:git Running git command [ 'stash', 'apply', '--index', 'stash@{0}' ] +93ms
  lint-staged:git Running git command [ 'clean', '-df' ] +26s
  lint-staged:git Running git command [ 'checkout', '.' ] +379ms
  lint-staged:git Running git command [ 'stash', 'list' ] +453ms
  lint-staged:git Running git command [
  'diff',
  '--unified=0',
  '--no-color',
  '--no-ext-diff',
  '--patch',
  'stash@{0}',
  '-R'
] +97ms
  lint-staged:git Done backing up original state! +31s
Preparing... [completed]
Running tasks... [started]
Running tasks for *.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx) [started]
  lint-staged:make-cmd-tasks Creating listr tasks for commands 'yarn lint:staged' +0ms
  lint-staged:task cmd: yarn lint:staged +0ms
  lint-staged:task execaOptions: { preferLocal: true, reject: false, shell: false } +0ms
yarn lint:staged [started]
yarn lint:staged [completed]
Running tasks for *.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx) [completed]
Running tasks... [completed]
Applying modifications... [started]
  lint-staged:git Running git command [ 'ls-files', '--modified' ] +36s
Applying modifications... [completed]
Cleaning up... [started]
  lint-staged:git Dropping backup stash... +36s
  lint-staged:git Running git command [ 'stash', 'list' ] +188ms
  lint-staged:git Running git command [ 'stash', 'drop', '--quiet', 'stash@{0}' ] +98ms
  lint-staged:git Done dropping backup stash! +251ms
Cleaning up... [completed]
  lint-staged tasks were executed successfully! +1m
✨  Done in 67.86s.

@bugzpodder
Copy link
Author

bugzpodder commented Nov 2, 2019

reverting 50afea0 and everything worked smoothly. any way to check version and not do git clean -af? @iiroj @okonet
edit: I'm actually using git version 2.20.1 ...

@iiroj
Copy link
Member

iiroj commented Nov 3, 2019

I actually think there's no need to run git clean -df, since the workaround only affected deleted files getting restored. The git checkout . should clear those since they are in the index. Let's see what the tests think in #724

@okonet
Copy link
Collaborator

okonet commented Nov 13, 2019

Yes, git clean is very slow. I had it in my original version during the development and had to remove before releasing because it was so slow.

@iiroj
Copy link
Member

iiroj commented Nov 14, 2019

I found a nice workaround in cfde9ca

Basically before stashing everything with git stash save --include-untracked we get a diff of only the staged files with git diff --cached, and then after the stash removes everything, apply it back.

@iiroj
Copy link
Member

iiroj commented Nov 14, 2019

I will assume this is fixed in https://github.com/okonet/lint-staged/releases/tag/v10.0.0-beta.2%40beta and will close this issue. Please re-test and re-open if it still doesn't work correctly.

@iiroj iiroj closed this as completed Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants