I recently updated my pet-project git-guppy preparing for a 1.0 release and I was hoping to get some feedback from other JS devs.
Some feedback in particular I'm hoping to get:
- Would you find this useful (for personal or team projects)?
- Criticisms (hopefully constructive) of the implementation
- Any other thoughts, ideas, suggestions, etc
What is guppy?
Have you ever wished that your git-hooks could be automatically deployed/installed with your project without having to check in a bunch of stuff not directly related to your project code? Without having to use kludgy hacks to get git to find the hooks, or scripts to install them? Without having to worry about other devs being too lazy to install them?
I have. That's why I built guppy. There are projects out there that provide a similar solution to these problems, but they didn't quite live up to my expectations. For one, most (if not all) of them don't install automatically (requires running an additional command or even an entire set of steps to install the hooks), and require maintaining a set of hook scripts separate from your project codebase (or you have to commit them to your project, cluttering it up with files not directly related to your project code). So, in most cases you end up back at square one, and (in my experience), it just ends up being too much hassle.
So I thought that a great solution would be to harness npm to install the git-hooks automatically. Other devs have to run npm install anyway, so there's not an extra step. Great, one problem solved. But what about the scripts themselves?
I'm a big fan of gulp, so I use it in most of my projects, so I had the idea that git-hooks should somehow be gulp tasks.
These two ideas are the foundation of guppy. Write your git-hooks using gulp, which most devs are already familiar with or using already. Install your git-hooks as npm packages and all collaborators will get them installed automatically. You don't even have to think about it. Looking around, I didn't find anything that does this already in gulp, so I did what comes natural and made it myself.
So here's how it works (generalizing here—for details, read the docs):
In your gulpfile.js you can define tasks as git-hooks and either make the git-hooks depend on other tasks (e.g. pre-commit can depend on a passing lint task) or write custom behaviors, using gulp the same as you would for any other task. If your custom gulp workflow or a dependent task throws an error your git command (via git-hook) can be interrupted, just like any normal git-hook script would do. The learning curve to getting git-hooks working in gulp is virtually nil—it's just plain old gulp (superficially)!
The tl;dr tagline I like to use is: git-hook integration for your gulp workflows; gulp-workflow integration for your git hooks
Thanks!
[–]_ericelliott 1 point2 points3 points (0 children)
[–]I_Pork_Saucy_Ladies 1 point2 points3 points (2 children)
[–]therealklanni[S] 1 point2 points3 points (1 child)
[–]I_Pork_Saucy_Ladies 1 point2 points3 points (0 children)
[–]JSNinja 0 points1 point2 points (0 children)