The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
The shared logic lives in the githook/ package and is also imported by
tailscale/corp.
Install
From the repo root:
./tool/go run ./misc/add-git-hooks.go
The script auto-updates in the future.
Adding your own hooks
Create an executable .git/hooks/<hook-name>.local to chain a custom
script after a built-in hook. For example, put a custom check in
.git/hooks/pre-commit.local and chmod +x it. The local hook runs
only if the built-in hook succeeds; failure aborts the git operation.
Version bumps
The launcher rebuilds when the installed binary's version differs from
the concatenation of two files:
githook/HOOK_VERSION (shared): bump when changing anything under
githook/ or git-hook.go. Downstream repos pick it up after
bumping their tailscale.com dependency.
misc/git_hook/HOOK_VERSION (repo-local, optional): bump to force a
rebuild for repo-specific config changes without touching the shared
version. This repo does not use one.
The git-hook command is Tailscale's git hook binary, built and
installed under .git/hooks/ts-git-hook-bin by the launcher at
.git/hooks/ts-git-hook. misc/add-git-hooks.go writes the initial
launcher; subsequent HOOK_VERSION bumps trigger self-rebuilds.
To add your own hook alongside one we already hook, create an executable
file .git/hooks/<hook-name>.local (e.g. pre-commit.local). It runs after
the built-in hook succeeds.