-
Notifications
You must be signed in to change notification settings - Fork 30
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
Hooks should not be ignored by .gitignore #35
Comments
It seems that you want to run user hooks which put in Do you really have a such case? What kind of hooks do you need to run but don't want to commit? |
I agree with warning. Currently, there is a check against executable files, although this does not apply to Windows. There is no check for files starting with a This being said, the original use case (#12) doesn't convince me that there's a need for this feature, as one can set the vim save location to a different directory (e.g. |
@tarmolov he does not want to run hooks from |
In my point of view, It means that If you have a specific case in your work which doesn't solve by |
No, not $HOME/.githooks - I'm talking about the feature that checks if a hook is matched by .gitignore rules and doesn't run it if it is. I think this is a misfeature. The original problem (#12) would be covered by ignoring files starting I'm requesting a feature that is currently broken & unnecessary be removed, not that a new feature be added. I used to work on a project where I had to write dietitian a lot, but I kept writing dietician. We had pre-commit hooks for checking code style etc. that were shared with all devs (managed by some scripts that we wrote), and I added my own one to grep for dietician and prevent me committing. It would be embarrassing to commit that to the project - it's purely an artefact of my bad spelling. Under the current scheme I can't gitignore my own script, I have to commit it, or remember never to use I don't need this feature now, but I can imagine being confused by it if I stumble across it by mistake. |
I got your point. Thank you. I'll think how to solve it properly. |
Any update ? |
Nope but I'm going to fix it in the nearest future. Is it urgent for you? |
No, just wondering, as our discussion in other PR is affected by the code that controls this behaviour. |
(moved from discussion in #30)
Currently this project has code to check if a hook file is included in .gitignore and not run it if that is the case. This was inspired by a problem where a vim
.[filename].swp
file was executed while developing a git hook: #12This looses the ability to have local git hooks that you might want to deliberately ignore because you don't want to commit them, but you do want to run them on all your commits, and you do want to use the git-hooks-js folder structure because you have other hooks that you do want committed.
The vim swap file is not executable, and starts with a
.
character. Either of these reasons should be enough to not run the file. Perhaps a warning could be displayed on such files, something like "not running hook named .foobar.swp as it starts with a ." and / or "not running hook named .foobar.swp as it is not executable".The text was updated successfully, but these errors were encountered: