question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On v10.0.0-0, committing changes to a JS file from Github Desktop fails

See original GitHub issue

Description

When committing changes to a JS (flow) file using the Github Desktop app, I get an error that I reproduced below under Debug Logs (with the --debug flag active). The salient error message seems to be: error: unknown option no-overlay’` image

Steps to reproduce

Attempt to commit changes to a JS file (including flow syntax) from the Github Desktop app. As you can see in the debug logs, I am running prettier --write and eslint --fix on all staged JS files (plus git add). The error seems to occur when lint-staged runs:

git command [ 'stash',
  'save',
  '--quiet',
  '--include-untracked',
  '--keep-index',
  'lint-staged automatic backup' ]

if relevant, our .prettierrc config specifies flow as the parser for *.js files like so:

overrides:
- files: "*.js"
  options:
    parser: flow

Debug Logs

expand to view
Commit failed - exit code 1 received, with output: 'husky > pre-commit (node v11.11.0)
2019-10-21T17:38:19.221Z lint-staged:bin Running `lint-staged@10.0.0-0`
2019-10-21T17:38:19.223Z lint-staged Loading config using `cosmiconfig`
2019-10-21T17:38:19.234Z lint-staged Successfully loaded config from `/Users/andrew/Projects/next/node/package.json`:
{ '*.{css,js,json,less,md}': [ 'prettier --write', 'git add' ],
  '*.js': [ 'eslint --fix', 'git add' ] }
2019-10-21T17:38:19.234Z lint-staged:cfg Validating config
Running lint-staged with the following config:
{
  '*.{css,js,json,less,md}': [
    'prettier --write',
    'git add'
  ],
  '*.js': [
    'eslint --fix',
    'git add'
  ]
}
2019-10-21T17:38:19.239Z lint-staged:run Running all linter scripts
2019-10-21T17:38:19.239Z lint-staged:git Running git command [ 'rev-parse', '--show-toplevel' ]
2019-10-21T17:38:19.266Z lint-staged:run Resolved git directory to be `/Users/andrew/Projects/next`
2019-10-21T17:38:19.267Z lint-staged:git Running git command [ 'diff', '--staged', '--diff-filter=ACMR', '--name-only' ]
2019-10-21T17:38:19.276Z lint-staged:run Loaded list of staged files in git:
[ 'node/shared/components/rich-text/RichText.js' ]
2019-10-21T17:38:19.276Z lint-staged:gen-tasks Generating linter tasks
2019-10-21T17:38:19.284Z lint-staged:gen-tasks Generated task: 
{ pattern: '*.{css,js,json,less,md}',
  commands: [ 'prettier --write', 'git add' ],
  fileList:
   [ '/Users/andrew/Projects/next/node/shared/components/rich-text/RichText.js' ] }
2019-10-21T17:38:19.284Z lint-staged:gen-tasks Generated task: 
{ pattern: '*.js',
  commands: [ 'eslint --fix', 'git add' ],
  fileList:
   [ '/Users/andrew/Projects/next/node/shared/components/rich-text/RichText.js' ] }
Preparing... [started]
2019-10-21T17:38:19.287Z lint-staged:git Backing up original state...
2019-10-21T17:38:19.287Z lint-staged:file Trying to access `/Users/andrew/Projects/next/.git/MERGE_HEAD`
2019-10-21T17:38:19.291Z lint-staged:file Unable to access file `/Users/andrew/Projects/next/.git/MERGE_HEAD` with error:
2019-10-21T17:38:19.291Z lint-staged:file Error: ENOENT: no such file or directory, access '/Users/andrew/Projects/next/.git/MERGE_HEAD'
2019-10-21T17:38:19.291Z lint-staged:git Running git command [ 'ls-files', '--others', '--exclude-standard' ]
2019-10-21T17:38:19.331Z lint-staged:git Running git command [ 'stash',
  'save',
  '--quiet',
  '--include-untracked',
  '--keep-index',
  'lint-staged automatic backup' ]
Preparing... [failed]
→ error: unknown option `no-overlay'
usage: git checkout [<options>] <branch>
   or: git checkout [<options>] [<branch>] -- <file>...

    -q, --quiet           suppress progress reporting
    -b <branch>           create and checkout a new branch
    -B <branch>           create/reset and checkout a branch
    -l                    create reflog for new branch
    --detach              detach HEAD at named commit
    -t, --track           set upstream info for new branch
    --orphan <new-branch>
                          new unparented branch
    -2, --ours            checkout our version for unmerged files
    -3, --theirs          checkout their version for unmerged files
    -f, --force           force checkout (throw away local modifications)
    -m, --merge           perform a 3-way merge with the new branch
    --overwrite-ignore    update ignored files (default)
    --conflict <style>    conflict style (merge or diff3)
    -p, --patch           select hunks interactively
    --ignore-skip-worktree-bits
                          do not limit pathspecs to sparse entries only
    --ignore-other-worktrees
                          do not check if another worktree is holding the given ref
    --recurse-submodules[=<checkout>]
                          control recursive updating of submodules
    --progress            force progress reporting

error: unknown option `no-overlay'
usage: git checkout [<options>] <branch>
   or: git checkout [<options>] [<branch>] -- <file>...

    -q, --quiet           suppress progress reporting
    -b <branch>           create and checkout a new branch
    -B <branch>           create/reset and checkout a branch
    -l                    create reflog for new branch
    --detach              detach HEAD at named commit
    -t, --track           set upstream info for new branch
    --orphan <new-branch>
                          new unparented branch
    -2, --ours            checkout our version for unmerged files
    -3, --theirs          checkout their version for unmerged files
    -f, --force           force checkout (throw away local modifications)
    -m, --merge           perform a 3-way merge with the new branch
    --overwrite-ignore    update ignored files (default)
    --conflict <style>    conflict style (merge or diff3)
    -p, --patch           select hunks interactively
    --ignore-skip-worktree-bits
                          do not limit pathspecs to sparse entries only
    --ignore-other-worktrees
                          do not check if another worktree is holding the given ref
    --recurse-submodules[=<checkout>]
                          control recursive updating of submodules
    --progress            force progress reporting

husky > pre-commit hook failed (add --no-verify to bypass)'

Environment

  • OS: macOS Catalina
  • Node.js: 11.11.0
  • lint-staged: 10.0.0-0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

6reactions
xlsdgcommented, Mar 19, 2020

Similar problem here

 lint-staged:git Done backing up merge state!
 lint-staged:git Running git command [ 'ls-files', '--deleted' ]
 lint-staged:git Running git command [
  'stash',
  'save',
  '--include-untracked',
  '--keep-index',
  'lint-staged automatic backup'
]
Preparing... [failed]
→ error: unknown option 'ignore-skip-worktree-entries'
usage: git update-index [<options>] [--] [<file>...]

    -q                    continue refresh even when index needs update
    --ignore-submodules   refresh: ignore submodules
    --add                 do not ignore new files
    --replace             let files replace directories and vice-versa
    --remove              notice files missing from worktree
    --unmerged            refresh even if index contains unmerged entries
    --refresh             refresh stat information
    --really-refresh      like --refresh, but ignore assume-unchanged setting
    --cacheinfo <mode>,<object>,<path>
                          add the specified entry to the index
    --chmod (+|-)x        override the executable bit of the listed files
    --assume-unchanged    mark files as "not changing"
    --no-assume-unchanged
                          clear assumed-unchanged bit
    --skip-worktree       mark files as "index-only"
    --no-skip-worktree    clear skip-worktree bit
    --info-only           add to index only; do not add content to object database
    --force-remove        remove named paths even if present in worktree
    -z                    with --stdin: input lines are terminated by null bytes
    --stdin               read list of paths to be updated from standard input
    --index-info          add entries from standard input to the index
    --unresolve           repopulate stages #2 and #3 for the listed paths
    -g, --again           only update entries that differ from HEAD
    --ignore-missing      ignore files missing from worktree
    --verbose             report actions to standard output
    --clear-resolve-undo  (for porcelains) forget saved unresolved conflicts
    --index-version <n>   write index in this format
    --split-index         enable or disable split index
    --untracked-cache     enable/disable untracked cache
    --test-untracked-cache
                          test if the filesystem supports untracked cache
    --force-untracked-cache
                          enable untracked cache without testing the filesystem
    --force-write-index   write out the index even if is not flagged as changed
    --fsmonitor           enable or disable file system monitor
    --fsmonitor-valid     mark files as fsmonitor valid
    --no-fsmonitor-valid  clear fsmonitor valid bit

Environment

  • OS: macOS Catalina 10.15.3
  • Node.js: 12.16.1
  • lint-staged: 10.0.8
  • Sourcetree Desktop: 4.0.1
  • Git: 2.23.0
  • Husky: 4.2.3

PS

  • git: 2.23.0 and husky: 3.1.0 and lint-staged: 10.0.8 is ok!
  • git: 2.23.0 and husky: 4.2.3 and lint-staged: 9.5.0 is ok!
  • git: 2.23.0 and husky: 4.2.3 and lint-staged: 10.0.8 is error!
  • git: 2.25.1 and husky: 4.2.3 and lint-staged: 10.0.8 is ok!

Fix

sudo launchctl config user path $PATH

3reactions
shaun-addeparcommented, Oct 6, 2020

I was getting similar error. Closing VS code & its terminal and opening fresh terminal fixed it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Critical bug: GitHub desktop believes files are changed which ...
This is a critical error since these files has not been changed by me and I should not do a commit with them....
Read more >
Partially staged files · Issue #30 · azz/pretty-quick - GitHub
I'm using pretty-quick@1.5.0 and I have the same problem. error Command failed. Exit code: 1 Command: git Arguments: commit -m v0.0.108 ...
Read more >
Unable to push in GitHub desktop · Issue #4181
Description I've been using GitHub Desktop to push my changes to my repo on ... latest commit, I got the following error: Authentication...
Read more >
Desktop fails to run pre-commit hooks on node 16+ #12562
Make some changes to a file in a project with a pre-commit script (I'm using the npm ... Bug: Github Desktop throws an...
Read more >
Cannot commit 1.3 MB file · Issue #13733 · desktop ... - GitHub
Describe the bug I am using github pages for running Flutter for Web app. There are two large files: main.dart.js (1.3 MB) and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found