Skip to content

git apply error when using git-crypt #776

Description

@ranimufid

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 input

git 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-crypt

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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions