-
Notifications
You must be signed in to change notification settings - Fork 220
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
GIT_TEMPLATE_DIR Compatibility #815
Comments
Hey @quintrino! Thank you for submitting a feature request. Could you describe in more details how this would differ from having a |
So I guess my desire is to have lefthook be added automatically on all projects I git init or git clone. my limited understanding of lefthook is that currently you have to add lefthook manually to every git repo using Other githook managers do this by setting a git template (and therefore git hook template) using the GIT_TEMPLATE_DIR env, is there another way to have lefthook automatically applied to all repos? |
I see, the problem is that Could you share the info about other hook managers? I am curious, maybe I could get inspired and implement something similar in lefthook. Also there's a postinstall script in lefthook NPM package which runs |
So overcommit handles it here. |
I guess it can be solved by using a repo starter template. E.g. a repo that contains lot of things preconfigured. It's also useful for setting up many other things (which are often language- or framework-specific). Many package managers have default install commnads, so to create a new TypeScript repo, I just clone the starter repo, unset the origin, then run |
⚡ Summary
Git provides the ability to set a standard template for your git setup using the GIT_TEMPLATE_DIR, Lefthook should be able to point, or generate or store a template for git to use via the GIT_TEMPLATE_DIR ENV.
Value
Rather than having to remember to manually run lefthook add every time you clone a repo you're looking to add functionality on, this would allow it to happen automatically.
Behavior and configuration changes
a command such as
lefthook template
would point to a directory that could be saved viaexport GIT_TEMPLATE_DIR=$(lefthook template)
or maybe it could create one at $XDG_CONFIG_HOME/lefthook/template or something.
The text was updated successfully, but these errors were encountered: