Skip to content

Add version check in post-checkout hook#8

Merged
albertodebortoli merged 1 commit intomainfrom
install-luca-in-post-checkout
Mar 11, 2026
Merged

Add version check in post-checkout hook#8
albertodebortoli merged 1 commit intomainfrom
install-luca-in-post-checkout

Conversation

@albertodebortoli
Copy link
Member

@albertodebortoli albertodebortoli commented Mar 11, 2026

Summary

  • post-checkout now checks the installed luca version against .luca-version on every branch checkout, triggering a reinstall when they don't match
  • Adds is_luca_version_correct() helper alongside is_luca_installed()
  • Logs a clear mismatch message (installed: vX, required: vY) when an update is triggered
  • Fixes a pre-existing bug in shell_hook.bats where the idempotent PATH test used a broad grep pattern (\.luca/tools) that matched the user's real ~/.luca/tools install, causing a false count of 2

Test plan

  • 3 new BATS tests in post_checkout.bats: version matches (no reinstall), version mismatch (triggers update with message), no .luca-version file (skips check)
  • Full suite passes: bats tests/ → 54/54
  • Manually switch to a branch with a different .luca-version and verify the mismatch message appears

🤖 Generated with Claude Code

Check installed luca version against .luca-version on branch checkout,
triggering a reinstall when there is a mismatch. Also fixes the
shell_hook idempotent PATH test to match only the project-specific
.luca/tools entry, avoiding false positives when luca is installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@albertodebortoli albertodebortoli merged commit 3244acf into main Mar 11, 2026
2 checks passed
@albertodebortoli albertodebortoli deleted the install-luca-in-post-checkout branch March 11, 2026 14:41
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