Skip to content

Improve context on pre-commit hook failures and provide escape hatch #9351

@j-f1

Description

@j-f1

Describe the bug

I cannot commit to the excalidraw/excalidraw repo in GitHub Desktop. Using GitUp (another GUI) or the git CLI both work fine.L

Version & OS

GitHub Desktop Version 2.4.0, macOS Version 10.15.3 (19D76)

Steps to reproduce the behavior

  1. Clone https://github.com/excalidraw/excalidraw
  2. Run npm install to install the dependencies
  3. Open the repo in your favorite editor and delete lines 8–18 of src/index.tsx so you have something to commit.
  4. In GitHub Desktop, commit the change.

Expected behavior

The commit occurs successfully.

Actual behavior

An error dialog displaying this text:

Details
Commit failed - exit code 1 received, with output: 'husky > pre-commit (node v13.11.0)
Preparing... [started]
Preparing... [failed]
→ error: unknown option 'ignore-skip-worktree-entries'
usage: git update-index [<options>] [--] [<file>...]

[removed: listing of all options]

Cannot save the current worktree state
Running tasks... [started]
Running tasks... [skipped]
→ Skipped because of previous git error.
Applying modifications... [started]
Applying modifications... [skipped]
→ Skipped because of previous git error.
Cleaning up... [started]
Cleaning up... [skipped]
→ Skipped because of previous git error.

  ✖ lint-staged failed due to a git error.
  Any lost modifications can be restored from a git stash:

    > git stash list
    stash@{0}: On master: automatic lint-staged backup
    > git stash pop stash@{0}

error: unknown option 'ignore-skip-worktree-entries'

[removed: listing of all options]

Cannot save the current worktree state
husky > pre-commit hook failed (add --no-verify to bypass)

Additional context

I’m guessing this is because --ignore-skip-worktree-entries was recently added to Git and Husky is using Desktop’s bundled version for some reason?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions