git apply error when using git-crypt
Author: ranimufidCreated Jul 2, 2018Updated Feb 14, 2025
Labelsbug
Hi. I am currently using git-crypt in tandem with some pre-commit hooks
Upon adding a new file for encryption --> a corresponding .gitattributes entry --> git commit -m "blah" I encounter the following error:
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/bob/.cache/pre-commit/patch1530518673.
Trim Trailing Whitespace.................................................Passed
Check Yaml...............................................................Passed
Fix End of Files.........................................................Passed
Ansible-lint.............................................................Passed
[WARNING] Stashed changes conflicted with hook auto-fixes... Rolling back fixes...
An unexpected error has occurred: CalledProcessError: Command: ('/usr/local/Cellar/git/2.18.0/libexec/git-core/git', '-c', 'core.autocrlf=false', 'apply', '--whitespace=nowarn', '/Users/bob/.cache/pre-commit/patch1530518673')
Return code: 128
Expected return code: 0
Output: (none)
Errors:
error: unrecognized inputgit version: 2.18.0
pre-commit version: 1.10.2
.pre-commit-config.yaml
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v1.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: end-of-file-fixer
- repo: https://github.com/willthames/ansible-lint.git
rev: v3.4.23
hooks:
- id: ansible-lint
entry: ansible-lint bootstrap.yml.gitattributes:
hosts/testing/secret-vars.yml filter=git-crypt diff=git-cryptSource: pre-commit/pre-commit