Summary
When committing on a Windows environment with mixed-line-ending configured with --fix=lf, the hook runs against COMMIT_EDITMSG, fixes the CRLF line endings to LF, and exits with code 1, aborting the commit.
Environment
- OS: Windows
- pre-commit version: 3.8.0
- pre-commit-hooks version: v6.0.0
- Git version: 2.50.1
Configuration (.pre-commit-config.yaml)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=500]
- id: check-yaml
args: [--unsafe]
- id: forbid-submodules
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
Expected Behavior
mixed-line-ending should either ignore COMMIT_EDITMSG by default or handle system-generated commit message files without failing the commit step on Windows.
Summary
When committing on a Windows environment with
mixed-line-endingconfigured with--fix=lf, the hook runs againstCOMMIT_EDITMSG, fixes the CRLF line endings to LF, and exits with code 1, aborting the commit.Environment
Configuration (
.pre-commit-config.yaml)Expected Behavior
mixed-line-endingshould either ignoreCOMMIT_EDITMSGby default or handle system-generated commit message files without failing the commit step on Windows.