-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
optional feature for auto installing the hooks on cloned repos #1084
Comments
I use this: https://github.com/asottile/scratch/blob/357638a6f88261ad3715dfe2e4bbdea653f756e3/.bashrc#L21 there isn't really a way to hook into though I guess maybe it could be provided as |
@ssbarnea thought on that? |
Actually, seems now that I've fixed up some things since the original implementation, I think it might make sense to have a
|
Your prompt hack seems to do exactly that but I do not find it as a scalable solution, especially as it adds extra time for each chdir and that it does not work with all shells. On the other hand, the templates approachs seems super nice. It would call pre-commit on each clones git repo but silently doing nothign if the repository is not pre-commit enable. No problems with shells or performanc impact on chdir. I really like it, going to start testing it right away. |
@asottile One first problem that I spotted is that I had to manually mention the template directory, when this should have being the implicit location
I also hope this would not remove other templates from there. Another issue is that I got an unexpected warning:
I guess that while testing the current location of git-template-dir, pre-commit is missing to resolve their paths. The folder happened to be the same but the code complains about it. IMHO, just using what is returned from |
Ah it probably needs os.path.expanduser |
As pre-commit becomes more and more popular I often face myself the problem that I forget to install the hooks on newly cloned repositories.
What it would be cook is if (at clone time?) I could get a prompt that would ask me if I want to enable the hooks or not for that repository.
The idea is to find a way to detect that a repository has pre-commit but the hooks ar ere not installed and allow user to install them, with 1-2 key strokes.
The text was updated successfully, but these errors were encountered: