npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-vaudeville

v0.1.1

Published

Hook management system for git

Downloads

3

Readme

Git-Vaudeville

git-vaudeville is a simple git hook management system. It is language-agnostic, and allows to have global and per-project hooks.

Installation

npm install -g git-vaudeville

Usage

To unleash the power of git-vaudeville, first you need to enable it on a given repository:

$ cd ~/work/my-repo
$ git-vaudeville install

The install will create shims for vaudeville in .git/hooks (if scripts already exist there, they will be safely moved to a timestamped backup subdirectory). It will also create a .git/hooks/vaudeville directory with subdirectories for each type of git hook.

Then you may drop scripts in either those local vaudeville directories, or in the global ~/git/vaudeville/_hook-type_ directory. Those scripts can be written in any language, as long as they are executable, it's all :100:.

You can get a summary of the hooks that are active for a given repository via git vaudeville info:

$ git vaudeville info
Vaudeville directories
 - /home/yanick/git-vaudeville
 - ./.git/hooks/vaudeville
pre-commit
 - foo
    .git/hooks/vaudeville
pre-push
 - do-not-push.fish
    ~/git-vaudeville - don't push if string 'DO NOT PUSH' is present

And... that's it. Now vaudeville will call all the pertinent scripts for each phase.

Commands

git vaudeville info

Provides a report of the directories vaudeville looks at for hook scripts, as well as all the hooks it found.

If a script contains a line beginning with ABSTRACT:, it is used as its description in the listing.

git vaudeville install

Installs the vaudeville shims locally in the current repository. If scripts already exist in .git/hooks, they are safely copied in a timestamped subdirectories.

The installation also creates .git/hooks/vaudeville and its subdirectories.

git vaudeville run <phase>

Runs all the hooks for a given phase. Typically you won't run it manually, but can be useful for testing / debugging.

Bear in mind that most hooks expect to get information via stdin. I.e., you'll likely have to call it like so:

$ echo "dummy HEAD dummy HEAD^" | git vaudeville run pre-push

# or

$ git vaudeville run pre-push --stdin "dummy HEAD dummy HEAD^"

git vaudeville help

Prints the list of commands.

Configuration

Vaudeville directories

By default Vaudeville looks for hooks in the global directory ~/git/vaudeville and the local directory ./.git/hooks/vaudevilles. This can be customized via the git configuration key vaudeville.dirs. For example, to use ~/git/vaudeville (for global hooks), ./.git/hooks/vaudeville (for local private hooks), and ./git-hooks (for public local hooks):

$ git config --global vaudeville.dirs ~/git/vaudeville,./.git/hooks/vaudeville,./git-hooks

Custom hook phases

It's totally possible to add custom hook phases by adding subdirectories of scripts in the vaudeville directories.

For example, I have a command git-integrate that merges work back to a main branch after running a bunch of checks:

#!/usr/bin/env fish

set -l branch $argv[1]

if test -z $branch
    set branch master
end

git vaudeville run integrate ( git rev-parse HEAD) $branch

and git checkout $branch

and git merge --no-ff -

Alternatives

  • git-hooks. (although you might want to use Sweth's maintained fork) Shell-based, very close to vaudeville. Main difference is git-hooks wants the hooks to live in the repo (under ./git-hooks), whereas vaudeville hides them under .git/hooks/vaudeville.

Thanks

Mad props go to Gizmo Mathboy to have come up with the name Vaudeville.