Skip to content

feat: notify-only version check#32

Open
jfding wants to merge 7 commits into
masterfrom
feat/version-check
Open

feat: notify-only version check#32
jfding wants to merge 7 commits into
masterfrom
feat/version-check

Conversation

@jfding

@jfding jfding commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a version subcommand that prints the current version and checks GitHub for a newer stable release, plus a cached background check at watch startup (one-line notice if outdated).
  • Notify-only: never downloads or replaces the binary.
  • Detection uses git ls-remote --tags --refs via the system git binary (already a hard runtime dependency) — no new Rust dependency, no C compiler, no TLS stack. This was chosen over an HTTP client + the Releases API because ureq+rustls pulls in ring, which breaks the static-musl build (needs a musl C compiler).
  • Latest-release detection: parse ls-remote tags, filter to stable vX.Y.Z tags, pick the highest by numeric semver.
  • Background check is cache-gated (24h, ~/.cache/git-supervisor/version-check.json), runs on a blocking thread, and swallows all errors so it never interrupts watch.

Test Plan

  • cargo test — 105 passed, 2 ignored
  • Pure helpers unit-tested: parse_ls_remote_tags, latest_stable_tag, compare_versions, notify_line, cache_is_stale
  • clap wiring test for the version subcommand
  • Manual: git-supervisor version against the live repo prints "You are on the latest release." at v2.1.8 and writes the cache file

🤖 Generated with Claude Code

jfding and others added 7 commits June 15, 2026 18:05
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Detect the latest stable release tag with the system git binary instead of
an HTTP client, avoiding a C-compiler/TLS build dependency on the static
musl target. Pure helpers (parse_ls_remote_tags, latest_stable_tag,
compare_versions, notify_line, cache_is_stale) are unit-tested; fetch and
the two entry points are thin glue.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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