misc/git_hook: propagate shared HOOK_VERSION (#19476)

Move HOOK_VERSION into the githook package and export it as
githook.HookVersion, so tailscale/corp can reference it via
the shared-code bump instead of having to bump HOOK_VERSION
by hand.

New launcher.sh composes the wanted version from 2 sources:
the shared HOOK_VERSION and an optional repo local version,
misc/git_hook/HOOK_VERSION, for repo-specific config bumps.

Updates tailscale/corp#40381

Change-Id: I7cf16889ba53cb564cc2df7dfd7588748f542c55

Signed-off-by: Fernando Serboncini <fserb@tailscale.com>
This commit is contained in:
Fernando Serboncini
2026-05-04 12:38:28 -04:00
committed by GitHub
parent 290a6cc03c
commit 29122506be
5 changed files with 29 additions and 22 deletions
+6
View File
@@ -22,6 +22,12 @@ import (
//go:embed launcher.sh
var Launcher []byte
// HookVersion is the shared version of this package and launcher.sh.
// Bump HOOK_VERSION on any change under this package.
//
//go:embed HOOK_VERSION
var HookVersion string
// RunLocalHook runs an optional user-supplied hook at
// .git/hooks/<name>.local, if present.
func RunLocalHook(hookName string, args []string) error {