Skip to content

error: unknown option `sparse' during precommit #5453

Description

@bmuenzenmeyer

The new logic introduced within #5443 includes husky, but also what seems to be an expected version of git.

While doing development for another feature, I receive this error:

/c/src/nodejsorg (5451-lint-staged) 🔥 git commit -m "feat: add lint-staged"
error: unknown option `sparse'
usage: git add [<options>] [--] <pathspec>...
-n, --dry-run dry run
-v, --verbose be verbose
-i, --interactive interactive picking
-p, --patch select hunks interactively
-e, --edit edit current diff and apply
-f, --force allow adding otherwise ignored files
-u, --update update tracked files
--renormalize renormalize EOL of tracked files (implies -u)
-N, --intent-to-add record only the fact that the path will be added later
-A, --all add changes from all tracked and untracked files
--ignore-removal ignore paths removed in the working tree (same as --no-all)
--refresh don't add, only refresh the index
--ignore-errors just skip files which cannot be added because of errors
--ignore-missing check if - even missing - files are ignored in dry run
--chmod (+|-)x override the executable bit of the listed files
--pathspec-from-file <file>
read pathspec from file
--pathspec-file-nul with --pathspec-from-file, pathspec elements are separated with NUL character
husky - pre-commit hook exited with code 129 (error)

--sparse is found here https://github.com/nodejs/nodejs.org/blob/main/.husky/pre-commit#L13-L14


My version of git is old

git version 2.28.0.windows.1

Upgrading git resolved this issue.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions