On v10.0.0-0, committing changes to a JS file from Github Desktop fails
See original GitHub issueDescription
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’`
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:
- Created 4 years ago
- Reactions:1
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Similar problem here
Environment
PS
git: 2.23.0
andhusky: 3.1.0
andlint-staged: 10.0.8
is ok!git: 2.23.0
andhusky: 4.2.3
andlint-staged: 9.5.0
is ok!git: 2.23.0
andhusky: 4.2.3
andlint-staged: 10.0.8
is error!git: 2.25.1
andhusky: 4.2.3
andlint-staged: 10.0.8
is ok!Fix
sudo launchctl config user path $PATH
I was getting similar error. Closing VS code & its terminal and opening fresh terminal fixed it.