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
+1 -5
View File
@@ -14,7 +14,6 @@
package main
import (
_ "embed"
"fmt"
"log"
"os"
@@ -23,9 +22,6 @@ import (
"tailscale.com/misc/git_hook/githook"
)
//go:embed HOOK_VERSION
var compiledHookVersion string
var pushRemotes = []string{
"git@github.com:tailscale/tailscale",
"git@github.com:tailscale/tailscale.git",
@@ -47,7 +43,7 @@ func main() {
var err error
switch cmd {
case "version":
fmt.Print(strings.TrimSpace(compiledHookVersion))
fmt.Print(strings.TrimSpace(githook.HookVersion) + ":0")
case "install":
err = githook.WriteHooks(hooks)
case "pre-commit":