-
Notifications
You must be signed in to change notification settings - Fork 397
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-hooks configuration #628
Comments
Yeah, I agree that we need more configurability around git hooks. #454 aimed at doing a bit of that, but it may make more sense to go with your approach and allow the entire hook to simply be replaced. |
You could disable the target, if you don't want it: http://blt.readthedocs.io/en/8.x/readme/extending-blt/#disabling-a-target You can also override BLT's handling of githooks entirely, now, via Phing tasks & overrides loaded via the 'import' property in project.yml. So, specify an XML file via that property and then create your own setup:git-hooks task that does what you want. We're doing this a lot for places where we have different needs than BLT is accounting for. Though, agree that the location of the git-hooks should be configurable. |
Hmm... that would actually work for me, but I actually want to keep the PHPUnit task, and remove the commit message task, so it might make sense to split those up as two different phing targets if that approach were going to work with me. Maybe the solution is a combination of both suggestions? |
Which Phing target needs to be split? |
The thing that has stumped me a little on this is the PHPUnit GitTest, I believe it's called. It seems even if I disable a target (I haven't tried just flat out disabling), that this test will still run, and cannot be configured or overridden. |
Oh I see. Good point about the test, that will fail. As a rule I think it's bad to add conditionals to unit tests, but we're not exactly using PHPUnit for a unit test in this case. We could simply check to see if the git hook has been disabled before running the assertion. |
Another possibility is to push #470 to the finish line and exclude GitTest from your CI build using |
@grasmash I'm still unsure how, once I disable a git-hook (mainly |
Would there be any consideration given to the ability to enable/disable the git-hooks through a setting, maybe in
project.yml
or a custom phing build file?Ideally, I would like the ability to have more flexibility around the git-hooks. I could see wanting to disable only the
commit-msg
git hook, or maybe providing my owncommit-msg
file altogether.The setup today makes it a little difficult and it is more "all or nothing". Maybe instead of just sym-linking
.git/hooks
->vendor/acquia/blt/scripts/git-hooks
, we could symlink to the individual files, and you could override each file location with a project specific file...?build.yml could have:
...then, in my project, I can override those with:
Thoughts?
Again, happy to give this a shot and produce a PR, just want to get some feedback first.
The text was updated successfully, but these errors were encountered: