-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
end-of-file-fixer fails against a ".git/MERGE_MSG" file #315
Comments
ah, probably want to |
Is it enabled for |
yeah it's always been enabled for all of the stages (or, more specifically it takes the default value which is then later treated as any stage) I wonder if the git version caused this file to be written differently 🤔 |
It contains 3 lines:
|
But why is the hook receiving this file as an input? |
The Question: are you intending to use the |
for what it's worth, I can also reproduce your findings on git 2.17.1 (ubuntu bionic): $ git merge origin/wat --no-ff -m 'Merge into master'
Already up to date!
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Failed
hookid: end-of-file-fixer
Fixing .git/MERGE_MSG
Not committing merge; use 'git commit' to complete the merge. $ cat .git/MERGE_MSG
Merge into master
$ |
This diff "fixes" it but I imagine this isn't quite satisfactory 😆 diff --cc .pre-commit-config.yaml
index 9c5d7e5,9c5d7e5..04191b2
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@@ -4,3 -4,3 +4,4 @@@ repos
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
++ stages: [commit, push] |
I'm using |
But I think that diff is quite correct, as it doesn't make sense for |
I've been meaning to make a top level |
We could only default the |
I say let's do it! Probably all the hooks in this repo should have that setup |
Released this as v1.4.0-1 |
Thanks again for the issue and fix 🎉 |
And thank you for the release ❤️ |
I'm running
git merge --no-ff release-7.1.2 -m "Merge branch 'release-7.1.2' into master"
and it fails because it's incorrectly checking files inside the.git
directory:The text was updated successfully, but these errors were encountered: