Skip to content

Rebuild dev binary automatically when local main moves - #26

Merged
claybridges merged 6 commits into
mainfrom
pr/refHook
Oct 22, 2026
Merged

claybridges merged 6 commits into
mainfrom
pr/refHook

Conversation

@claybridges

@claybridges claybridges commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

The dev binary went stale whenever main moved, and post-merge can't catch it: main is often detached, and finished work lands with git branch -f main. A reference-transaction hook fires on every ref update.

  • Hook is thin zsh; it only acts on a committed refs/heads/main update and always exits 0
  • Rebuild is scripts/rebuildDevBinary.go: builds from git archive main, so the active worktree doesn't matter, then installs atomically
  • Runs detached, so git never waits; concurrent triggers collapse into one extra rebuild
  • Opt in with go tool task main-hook:install. It symlinks the hook, so scripts/ changes take effect without re-installing
  • go tool task main-hook:uninstall removes it, and so does go tool task use-brew
  • Scripts are Go (//usr/bin/env go run first line, //go:build ignore), outside the normal build

🤖 Generated with Claude Code

@claybridges claybridges left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed.

@claybridges
claybridges merged commit c6ad04b into main Oct 22, 2026
2 checks passed
@claybridges
claybridges deleted the pr/refHook branch October 22, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant