feat(version): add stale binary detection with startup warning
Add detection for when the installed gt binary is out of date with the source repository. This helps catch issues where commands fail mysteriously because the installed binary doesn't have recent fixes. Changes: - Add internal/version package with stale binary detection logic - Add startup warning in PersistentPreRunE when binary is stale - Add gt doctor check for stale-binary - Use prefix matching for commit comparison (handles short vs full hash) The warning is non-blocking and only shows once per shell session via the GT_STALE_WARNED environment variable. Resolves: gt-ud912 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ Town root protection:
|
||||
- pre-checkout-hook Verify pre-checkout hook prevents branch switches (fixable)
|
||||
|
||||
Infrastructure checks:
|
||||
- stale-binary Check if gt binary is up to date with repo
|
||||
- daemon Check if daemon is running (fixable)
|
||||
- repo-fingerprint Check database has valid repo fingerprint (fixable)
|
||||
- boot-health Check Boot watchdog health (vet mode)
|
||||
@@ -116,6 +117,7 @@ func runDoctor(cmd *cobra.Command, args []string) error {
|
||||
d.Register(doctor.NewGlobalStateCheck())
|
||||
|
||||
// Register built-in checks
|
||||
d.Register(doctor.NewStaleBinaryCheck())
|
||||
d.Register(doctor.NewTownGitCheck())
|
||||
d.Register(doctor.NewTownRootBranchCheck())
|
||||
d.Register(doctor.NewPreCheckoutHookCheck())
|
||||
|
||||
Reference in New Issue
Block a user